[Numpy-discussion] Question about memmap

Pauli Virtanen pav at iki.fi
Wed Jun 10 03:13:22 EDT 2009

Wed, 10 Jun 2009 01:51:19 -0500, Gökhan SEVER kirjoitti:
> What's the reason again that memmap only works with binary files? 

There are no separate "text files" and "binary files". All files are 
binary, some just contain text that in some cases represents an array of 

Memmap views also text files as binary. It returns you an array 
representing the *character data* in the file.

> Could the functionality be extended to text files as well?

In principle, yes. But this would need special parsing of the text in the 
memmap. Doing this right would be considerably more work than just 
representing the binary data. Also, I doubt that this would be very 
useful: representing large amounts of data as text is not efficient. I 
also think few people have interest in this feature.

Pauli Virtanen

More information about the NumPy-Discussion mailing list