flip
Reverse the order of elements along the given axis or axes.| Name | Type | Default | Description |
|---|---|---|---|
m | ArrayLike | — | Input array. |
axis | number | number[] | undefined | Axis or axes along which to flip. If undefined, flips along all axes. |
NDArray — A new array with elements reversed along the specified axis.
fliplr
Flip an array left to right (reverse along axis 1). The input must have at least 2 dimensions.| Name | Type | Default | Description |
|---|---|---|---|
m | ArrayLike | — | Input array with at least 2 dimensions. |
NDArray — Array with columns reversed. Equivalent to flip(m, 1).
flipud
Flip an array up to down (reverse along axis 0).| Name | Type | Default | Description |
|---|---|---|---|
m | ArrayLike | — | Input array. |
NDArray — Array with rows reversed. Equivalent to flip(m, 0).
rot90
Rotate an array by 90 degrees in the plane specified by the given axes. The input must have at least 2 dimensions.| Name | Type | Default | Description |
|---|---|---|---|
m | ArrayLike | — | Input array with at least 2 dimensions. |
k | number | 1 | Number of 90-degree counter-clockwise rotations. Negative values rotate clockwise. |
axes | [number, number] | [0, 1] | The plane in which to rotate, defined by two axes. |
NDArray — The rotated array.
roll
Roll array elements along a given axis. Elements that roll past the last position wrap around to the first.| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
shift | number | number[] | — | Number of positions to shift. Positive shifts right, negative shifts left. If an array, each value corresponds to an axis. |
axis | number | number[] | undefined | Axis or axes along which to roll. If undefined, the array is flattened, rolled, then reshaped. |
NDArray — Array with elements rolled.
delete_
Remove elements from an array along an axis. Returns a new array (copy). Exported as bothdelete_ and delete.
| Name | Type | Default | Description |
|---|---|---|---|
arr | ArrayLike | — | Input array. |
obj | number | number[] | — | Index or indices of elements to remove. Negative indices are supported. |
axis | number | undefined | Axis along which to delete. If undefined, the array is flattened first. |
NDArray — A copy of a with the specified elements removed.
atleast_1d
Convert inputs to arrays with at least 1 dimension. Scalar (0-D) inputs become 1-D arrays of length 1. Higher-dimensional inputs are returned unchanged.| Name | Type | Default | Description |
|---|---|---|---|
...arrays | ArrayLike[] | — | One or more input arrays. |
NDArray | NDArray[] — A single array if one input was given, or a list of arrays if multiple inputs were given. Each output has ndim >= 1.
atleast_2d
Convert inputs to arrays with at least 2 dimensions. 0-D inputs become(1, 1), 1-D inputs of length N become (1, N). Higher-dimensional inputs are returned unchanged.
| Name | Type | Default | Description |
|---|---|---|---|
...arrays | ArrayLike[] | — | One or more input arrays. |
NDArray | NDArray[] — A single array if one input was given, or a list of arrays. Each output has ndim >= 2.
atleast_3d
Convert inputs to arrays with at least 3 dimensions. 0-D inputs become(1, 1, 1), 1-D inputs of length N become (1, N, 1), and 2-D inputs of shape (M, N) become (M, N, 1). Higher-dimensional inputs are returned unchanged.
| Name | Type | Default | Description |
|---|---|---|---|
...arrays | ArrayLike[] | — | One or more input arrays. |
NDArray | NDArray[] — A single array if one input was given, or a list of arrays. Each output has ndim >= 3.