-
Notifications
You must be signed in to change notification settings - Fork 3
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
Load function not working #4
Comments
Just submitted PR which fixed this error for me. If you don't want to wait, just replace line 26 with: shape = tuple(int(num) for num in str(header[60:120], 'utf-8').strip().replace(', }', '').replace('(', '').replace(')', '').split(',') if num != '') |
Yes that appears to be the case. I tried this out and the issue is coming from the line in the load() function:
This is specific logic that extracts the type of the array when it is something simple, but doesn't work in your case. A more robust approach is needed there, akin to "numpy.lib.format.read_array_header_2_0". Also, the total size of the data is calculated later with
which doesn't seem to work when you have a structured array since it cannot easily parse out the number and size of the different types in your array. I do not see a simple fix, but it should be possible. For now, I think the code should work if you create 4 separate arrays and save them individually. Not as elegant, unfortunately. |
Thanks for the reply. I guess I'll create a new issue for support of strucured arrays. But it seems from your reply, that this is not as simple as one would guess... |
Hi, I wanted to try out your save and load functions, but got this error with your load function:
I am using numpy 2.0.0, if that helps.
Thanks.
The text was updated successfully, but these errors were encountered: