vstack

Contents

vstack#

class brainunit.math.vstack(tup, dtype=None, **kwargs)#

Stack quantities or arrays in sequence vertically (row wise).

Parameters:
  • tup (Sequence[Array | ndarray | bool | number | bool | int | float | complex] | Sequence[saiunit.Quantity]) – The arrays must have the same shape along all but the first 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.vstack([a, b])