append

Contents

append#

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

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

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

  • values (Union[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 (Optional[int]) – 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:

Union[Array, saiunit.Quantity]

Examples

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