-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Opening Pickle Files using ma.dump in Python 3 #5491
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
Comments
Echoing my comments elsewhere:
Which I've done in #10192 |
* The np.ma functions are misleading, as they do not actually do anything special for ma.array * The np.loads functions doesn't even have numpy-specific documentation, and does not behave consistently with `np.load` * The string overloads of np.ma.load and np.ma.dump do not work well on python 3, as they make assumptions about whether a binary or text pickle file is used (numpygh-5491)
Alright, closing as wont-fix - these functions will be deprecated in 1.15.0, as of #10192 |
When using numpy.ma.dump to save a masked array in Python 3:
I got the following error:
This is with NumPy 1.9.1 and Python 3.3.2.
From what I found out, it is because in Python 3 pickle files has to be opened in binary mode, i.e. L7142 should be
F = open(F, 'wb')
. Indeed, if I were to change it to:the error goes away.
The text was updated successfully, but these errors were encountered: