hstack

Contents

hstack#

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

Stack quantities arrays in sequence horizontally (column wise).

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

  • dtype (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:

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])