Skip to content

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

Open
@eric-wieser

Description

@eric-wieser

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions