Skip to content

MAIN: fix to #7382, make scl in np.average writeable#7505

Merged
charris merged 1 commit intonumpy:masterfrom
ahaldane:fixup_7382
Apr 5, 2016
Merged

MAIN: fix to #7382, make scl in np.average writeable#7505
charris merged 1 commit intonumpy:masterfrom
ahaldane:fixup_7382

Conversation

@ahaldane
Copy link
Copy Markdown
Member

@ahaldane ahaldane commented Apr 4, 2016

In #7382 we make np.average use broadcast_to when returning scl, but as pointed out in #5706, broadcast_to returns a read-only array, which might cause problems. This PR fixes that by adding a .copy(), and also avoiding the broadcast/copy if not needed.

@charris
Copy link
Copy Markdown
Member

charris commented Apr 5, 2016

Note that you could make the returned array writable by setting the flag, which might be an alternative to copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants