append

Contents

append#

class brainunit.math.append(arr, values, axis=None, **kwargs)#

Append values to the end of a quantity or an array.

Parameters:
  • arr (Array | saiunit.Quantity) – Values are appended to a copy of this array.

  • values (Array | saiunit.Quantity) – These values are appended to a copy of arr. It must be of the correct shape (the same shape as arr, excluding axis).

  • axis (int | None) – The axis along which values are appended. If axis is None, values is flattened before use.

Returns:

res – A copy of arr with values appended to axis. Note that append does not occur in-place: a new array is allocated and filled.

Return type:

Array | saiunit.Quantity

Examples

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