hstack

Contents

hstack#

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

Stack quantities arrays in sequence horizontally (column wise).

Parameters:
  • arrays (Union[Sequence[Array | ndarray | number | bool], Sequence[saiunit.Quantity]]) – The arrays must have the same shape along all but the second axis.

  • 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 array formed by stacking the given arrays.

Return type:

Union[Array, saiunit.Quantity]

Examples

>>> import saiunit as u
>>> a = [1, 2, 3] * u.meter
>>> b = [4, 5, 6] * u.meter
>>> u.math.hstack([a, b])