-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
numpy.load() feature upgrade #644
Comments
I believe this is actually much more than just reading part of the file, at least, this is what I understand from this: https://numpy.org/doc/stable/reference/generated/numpy.memmap.html. Basically, you don't load anything with |
Can you implement a way to save the numpy arrays in append mode. Similarly, reading the numpy partial subarray of the numpy with somekind of 'offset' variable. |
Can you point to the relevant documentation? |
For appending arrays, there is a library. It is not part of the official numpy docs. for reading I haven't seen other way implemented than h5py or numpy.memmap |
I feel that we're rapidly going off-tangent, but still, here are a couple of comments:
|
This will help a lot. Anything lays out pointers to rows is good enough. |
It's not quite clear to me what your vision for such a function would be. The way you describe it seems to indicate that you'd need access to data that is not contiguous. Is that the case? |
let's say I have my data stored in ndarray (1000,7) in a file. The function should be able to allow to read some block of rows. The function I have implemented in Python allows to read contiguous rows from the file only.
|
OK, so one thing we could do is add the There might be an issue, and I don't quite know how to handle that: if you want to add |
I have created a header struct in my python struct which keeps track of array dtype and array shape.
Moreover, it's better that the write operation mode should be only overwrite mode so that we don't have to edit the header again and again. |
What you're saying here doesn't address the issue I mentioned earlier. If we add a keyword or something like that to Also, the title of this thread is "numpy.load() feature upgrade", so we shouldn't talk about write operations here. Even We might actually be better off adding the function to |
I wrote an implementation of .npy file loading/saving for MicroPython - which also supports streaming reading of data. The streaming API is different than the numpy.load() one - to allow accessing/validating the metadata/structure information before actually reading the data. https://github.com/jonnor/micropython-npyfile?tab=readme-ov-file#streaming-read |
numpy.load() feature upgrade
Hi,
Can you please add a very useful feature of using memmap to load only a part of numpy array from a file?
For example
Additional context
(https://numpy.org/doc/stable/reference/generated/numpy.load.html)
like using numpy.memmap inside numpy.load()
The text was updated successfully, but these errors were encountered: