Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Add axis argument to np.put to match np.take #8765

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

Open
eric-wieser opened this issue Mar 9, 2017 · 0 comments
Open

ENH: Add axis argument to np.put to match np.take #8765

eric-wieser opened this issue Mar 9, 2017 · 0 comments

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Mar 9, 2017

With the invariant that:

a = np.random.random(shape)
inds = ...
axis = ...

# copy some values from a to b
b = np.ones(a.shape) * np.nan
vals = np.take(a, inds, axis=axis)
np.put(b, inds, vals, axis=axis)

# check that the copy worked
assert_equal(vals, np.take(b, inds, axis=axis))
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

1 participant