[Numpy-discussion] Question about memmap

Pauli Virtanen pav@iki...
Wed Jun 10 02:13:22 CDT 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 
numbers.

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