concatenate

Contents

concatenate#

class saiunit.math.concatenate(arrays, axis=None, dtype=None, **kwargs)#

Join a sequence of quantities or arrays along an existing axis.

Parameters:
  • arrays (Union[Sequence[Array | ndarray | number | bool], Sequence[saiunit.Quantity]]) – The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

  • axis (Optional[int]) – The axis along which the arrays will be joined. Default is 0.

  • dtype (Union[str, type[Any], dtype, SupportsDType, None]) – If provided, the concatenation will be done using this dtype. Otherwise, the array with the highest precision will be used.

Returns:

res – The concatenated array. The type of the array is the same as that of the first array passed in.

Return type:

Union[Array, saiunit.Quantity]

Examples

>>> import saiunit as u
>>> a = [1, 2] * u.second
>>> b = [3, 4] * u.second
>>> u.math.concatenate([a, b])