concat

concat(arrays: Tuple[array, ...] | List[array], /, *, axis: int | None = 0) array

Joins a sequence of arrays along an existing axis.

Parameters:
  • arrays (Union[Tuple[array, ...], List[array]]) – input arrays to join. The arrays must have the same shape, except in the dimension specified by axis.

  • axis (Optional[int]) – axis along which to join the arrays. A valid axis must be an integer on the interval [-N, N), where N is the number of axes in each array. If an axis is specified as a negative integer, the function must determine the axis along which to perform the operation by counting backward from the last axis (where -1 refers to the last axis). If provided an invalid axis, the function must raise an exception. If axis is None, arrays must be flattened before concatenation. Default: 0.

Returns:

out (array) – an output array containing the concatenated values. If the input arrays have different data types, normal Type Promotion Rules must apply. If the input arrays have the same data type, the output array must have the same data type as the input arrays.

Note

This specification leaves type promotion between data type families (i.e., intxx and floatxx) unspecified and thus implementation-defined.