concatenate
Join a sequence of arrays along an existing axis. All arrays must have the same shape except along the concatenation axis.concat is an alias for concatenate.
| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of arrays to join. |
axis | number | 0 | Axis along which to concatenate. |
NDArray — The concatenated array.
stack
Join a sequence of arrays along a new axis. All input arrays must have the same shape.| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of arrays with identical shapes. |
axis | number | 0 | Axis in the result along which the input arrays are stacked. |
NDArray — The stacked array with one additional dimension.
vstack
Stack arrays vertically (row-wise). 1-D arrays of shape(N,) are first reshaped to (1, N). Equivalent to concatenate along axis 0 after that reshape.
row_stack is an alias for vstack.
| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of arrays. 1-D arrays are promoted to 2-D. |
NDArray — The vertically stacked array.
hstack
Stack arrays horizontally (column-wise). For 1-D arrays, concatenates along axis 0. For 2-D and higher arrays, concatenates along axis 1.| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of arrays to stack. |
NDArray — The horizontally stacked array.
dstack
Stack arrays depth-wise (along the third axis). 1-D arrays(N,) are reshaped to (1, N, 1) and 2-D arrays (M, N) to (M, N, 1) before stacking.
| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of arrays to stack. |
NDArray — The depth-stacked array (at least 3-D).
column_stack
Stack 1-D arrays as columns into a 2-D array. 1-D inputs are first reshaped to column vectors(N, 1), then horizontally stacked. 2-D and higher arrays are passed through to hstack unchanged.
| Name | Type | Default | Description |
|---|---|---|---|
arrays | ArrayLike[] | — | Sequence of 1-D or 2-D arrays. |
NDArray — 2-D array with each 1-D input as a column.
block
Assemble an array from nested sequences of blocks. For a flat list of N-D arrays, concatenates along the last axis.| Name | Type | Default | Description |
|---|---|---|---|
arrays | NestedArray | — | Nested list of arrays or array-like objects. A flat list [a, b] concatenates along the last axis. |
NDArray — The assembled array.
append
Append values to the end of an array. When no axis is given, both arrays are flattened before concatenation.| Name | Type | Default | Description |
|---|---|---|---|
arr | ArrayLike | — | Base array. |
values | ArrayLike | — | Values to append. |
axis | number | undefined | Axis along which to append. If undefined, both inputs are flattened first. |
NDArray — A copy of arr with values appended.
insert
Insert values into an array before specified indices.| Name | Type | Default | Description |
|---|---|---|---|
arr | ArrayLike | — | Input array. |
obj | number | number[] | — | Index or indices before which to insert. |
values | ArrayLike | — | Values to insert. |
axis | number | undefined | Axis along which to insert. If undefined, arr is flattened first. |
NDArray — A copy of arr with values inserted.