scipp.vector#

scipp.vector(value, *, unit=<automatically deduced unit>)#

Constructs a zero dimensional Variable holding a single length-3 vector.

Parameters
  • value (Union[ndarray, list]) – Initial value, a list or 1-D numpy array.

  • unit (Union[Unit, str, None], default: <automatically deduced unit>) – Unit of contents.

Returns

Variable – A scalar (zero-dimensional) variable of a vector.

See also

scipp.vectors

Examples

>>> sc.vector(value=[1, 2, 3])
<scipp.Variable> ()    vector3  [dimensionless]  [(1, 2, 3)]
>>> sc.vector(value=[4, 5, 6], unit='m')
<scipp.Variable> ()    vector3              [m]  [(4, 5, 6)]