8000 np.diagonal returns non-writeable array in 1.10.1 · Issue #7010 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

np.diagonal returns non-writeable array in 1.10.1 #7010

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

Closed
The-Fonz opened this issue Jan 14, 2016 · 1 comment
Closed

np.diagonal returns non-writeable array in 1.10.1 #7010

The-Fonz opened this issue Jan 14, 2016 · 1 comment

Comments

@The-Fonz
Copy link

Contrary to the docstring of np.diagonal, the returned array is non-writeable. The docstring says (predicts?) that for version 1.10 it is be writeable.

In [23]: np.version.full_version
Out[23]: '1.10.1'

In [24]: a = np.random.random(9).reshape((3,3))

In [25]: np.diagonal(a)[0] = 1
Traceback (most recent call last):

  File "<ipython-input-25-8277268b3e32>", line 1, in <module>
    np.diagonal(a)[0] = 1

ValueError: assignment destination is read-only
@njsmith
Copy link
Member
njsmith commented Jan 14, 2016

Doh, yes, as you've guessed, that's just a forgotten message from the past
that should have gotten updated at some point but never did. It indeed is
not writeable in 1.10, and won't be writeable in 1.11 either given that
we're only a few days from branching and haven't talked about it at all.
I'll submit a patch to fix the message.
On Jan 14, 2016 10:30 AM, "Fons" notifications@github.com wrote:

Contrary to the docstring of npdiagonal, the returned array is
non-writeable The docstring says (predicts?) that for version 110 it is be
writeable

In [23]: npversionfull_version
Out[23]: '1101'

In [24]: a = nprandomrandom(9)reshape((3,3))

In [25]: npdiagonal(a)[0] = 1
Traceback (most recent call last):

File "", line 1, in
npdiagonal(a)[0] = 1

ValueError: assignment destination is read-only


Reply to this email directly or view it on GitHub
#7010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0