Numpy Mmap: "valueerror: Size Of Available Data Is Not A Multiple Of Data-type Size."
I'm trying to get data from 'data.txt' into a numpy array and plot it with matplotlib. This is what each line of the data looks like: '1' 11.658870417634 4.8159509459201 with about
Solution 1:
That's a text file, not a binary file. memmap
only works if the data is stored as binary (i.e. stored as the array would be stored in memory).
You can convert the file to binary by reading it in, line-by-line, and storing each converted line in a writable memmap
.
Post a Comment for "Numpy Mmap: "valueerror: Size Of Available Data Is Not A Multiple Of Data-type Size.""