vindex
vindex closely corresponds to NumPy’s integer array indexing. It allows selection of arbitrary items in the array based on their N-dimensional index. Each integer array represents a number of indices into that dimension.
Advanced indices always are broadcast and iterated as one:
vindex is called with NDArray or number[] objects, but you can also freely mix in any of the arguments slice accepts. The order of dimensions in the result matches NumPy’s behaviour: if the advanced indices are contiguous, they replace in place; otherwise they are transposed to be the first dimensions.
take
Take elements from an array along an axis. The output preserves the shape ofindices: indexing with a 2-D index array produces an output whose indexed-axis is replaced by the index array’s shape. A scalar index reduces rank by one along that axis (NumPy semantics). Legacy number[] callers are unchanged.
Returns:
NDArray — Array of values taken from a. Its shape is [...a.shape[:axis], ...indices.shape, ...a.shape[axis+1:]].
put
Replace specified elements of an array with given values.
Returns:
void — The array a is modified in-place.
choose
Construct an array from an index array and a list of arrays to choose from.
Returns:
NDArray — Array formed by picking elements from choices according to a.
compress
Return selected slices of an array along a given axis.
Returns:
NDArray — Array containing only the slices of a where condition is true.
select
Return an array drawn from elements inchoicelist depending on conditions.
condlist and choicelist is run through asarray, so plain number[], boolean[], nested arrays, and NDArrays are all accepted. defaultVal is broadcast to the output shape, allowing per-element fall-through values. Existing scalar/NDArray calls behave identically.
|-|-|-|-|
Returns:
NDArray — Array where element i is taken from choicelist[j][i] for the first j where condlist[j][i] is true, or from defaultVal (broadcast) if no condition is true.
place
Change elements of an array based on a boolean mask and replacement values.
Returns:
void — The array arr is modified in-place.
putmask
Change elements of an array based on a boolean mask.
Returns:
void — The array a is modified in-place.
take_along_axis
Take values from an array by matching indices along an axis.
Returns:
NDArray — Array of values gathered from arr at the given indices along axis.
put_along_axis
Put values into an array by matching indices along an axis.
Returns:
void — The array arr is modified in-place.
copyto
Copy values from one array to another.
Returns:
void — The array dst is modified in-place.
broadcast_to
Broadcast an array to a new shape without copying data.
Returns:
NDArray — A read-only view of the original array with the given shape.
broadcast_arrays
Broadcast any number of arrays against each other.
Returns:
NDArray[] — List of arrays with the same shape, broadcast from the inputs.
broadcast_shapes
Compute the shape resulting from broadcasting the given shapes together.
Returns:
number[] — The broadcast shape.
Throws: Error if the shapes are not compatible for broadcasting.