See also
Indexing
c_
Translates slice objects to concatenation along the second axis.
r_
Translates slice objects to concatenation along the first axis.
s_
A nicer way to build up index tuples for arrays.
nonzero(a)
nonzero
Return the indices of the elements that are non-zero.
where(condition, [x, y])
where
Return elements chosen from x or y depending on condition.
indices(dimensions[, dtype, sparse])
indices
Return an array representing the indices of a grid.
ix_(*args)
ix_
Construct an open mesh from multiple sequences.
ogrid
nd_grid instance which returns an open multi-dimensional “meshgrid”.
ravel_multi_index(multi_index, dims[, mode, …])
ravel_multi_index
Converts a tuple of index arrays into an array of flat indices, applying boundary modes to the multi-index.
unravel_index(indices, shape[, order])
unravel_index
Converts a flat index or array of flat indices into a tuple of coordinate arrays.
diag_indices(n[, ndim])
diag_indices
Return the indices to access the main diagonal of an array.
diag_indices_from(arr)
diag_indices_from
Return the indices to access the main diagonal of an n-dimensional array.
mask_indices(n, mask_func[, k])
mask_indices
Return the indices to access (n, n) arrays, given a masking function.
tril_indices(n[, k, m])
tril_indices
Return the indices for the lower-triangle of an (n, m) array.
tril_indices_from(arr[, k])
tril_indices_from
Return the indices for the lower-triangle of arr.
triu_indices(n[, k, m])
triu_indices
Return the indices for the upper-triangle of an (n, m) array.
triu_indices_from(arr[, k])
triu_indices_from
Return the indices for the upper-triangle of arr.
take(a, indices[, axis, out, mode])
take
Take elements from an array along an axis.
take_along_axis(arr, indices, axis)
take_along_axis
Take values from the input array by matching 1d index and data slices.
choose(a, choices[, out, mode])
choose
Construct an array from an index array and a set of arrays to choose from.
compress(condition, a[, axis, out])
compress
Return selected slices of an array along given axis.
diag(v[, k])
diag
Extract a diagonal or construct a diagonal array.
diagonal(a[, offset, axis1, axis2])
diagonal
Return specified diagonals.
select(condlist, choicelist[, default])
select
Return an array drawn from elements in choicelist, depending on conditions.
lib.stride_tricks.sliding_window_view(x, …)
lib.stride_tricks.sliding_window_view
Create a sliding window view into the array with the given window shape.
lib.stride_tricks.as_strided(x[, shape, …])
lib.stride_tricks.as_strided
Create a view into the array with the given shape and strides.
place(arr, mask, vals)
place
Change elements of an array based on conditional and input values.
put(a, ind, v[, mode])
put
Replaces specified elements of an array with given values.
put_along_axis(arr, indices, values, axis)
put_along_axis
Put values into the destination array by matching 1d index and data slices.
putmask(a, mask, values)
putmask
Changes elements of an array based on conditional and input values.
fill_diagonal(a, val[, wrap])
fill_diagonal
Fill the main diagonal of the given array of any dimensionality.
nditer(op[, flags, op_flags, op_dtypes, …])
nditer
Efficient multi-dimensional iterator object to iterate over arrays.
ndenumerate(arr)
ndenumerate
Multidimensional index iterator.
ndindex(*shape)
ndindex
An N-dimensional iterator object to index arrays.
nested_iters
Create nditers for use in nested loops
flatiter
Flat iterator object to iterate over arrays.
lib.Arrayterator(var[, buf_size])
lib.Arrayterator
Buffered iterator for big arrays.