8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
It seems that ndarray.put disrespects writeable flag unlike other fancy indexing setters:
ndarray.put
In [1]: np.__version__ Out[1]: '1.8.0' In [2]: np.arange(10) Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) In [3]: _2.flags.writeable = False In [4]: _2[[1,2,3]] = 100 --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-4-6b16d30888f3> in <module>() ----> 1 _2[[1,2,3]] = 100 ValueError: assignment destination is read-only In [5]: _2.flat[[1,2,3]] = 100 --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-ad5ff20cf609> in <module>() ----> 1 _2.flat[[1,2,3]] = 100 ValueError: underlying array is read-only In [6]: _2.put([1,2,3], 100) In [7]: _2 Out[7]: array([ 0, 100, 100, 100, 4, 5, 6, 7, 8, 9])
At least 1.8.0 is affected, but given that PyArray_PutTo doesn't include PyArray_FailUnlessWriteable in master, I'd say master is affected too.
PyArray_PutTo
PyArray_FailUnlessWriteable
master
The text was updated successfully, but these errors were encountered:
BUG: Make PyArray_PutTo respect writeable flag.
76318dc
Closes numpy#4465.
892c469
No branches or pull requests
It seems that
ndarray.put
disrespects writeable flag unlike other fancy indexing setters:At least 1.8.0 is affected, but given that
PyArray_PutTo
doesn't includePyArray_FailUnlessWriteable
in master, I'd saymaster
is affected too.The text was updated successfully, but these errors were encountered: