scipp.index#

scipp.index(value, *, dtype=None)#

Constructs a zero dimensional Variable representing an index.

This is equivalent to calling scipp.scalar() with unit=None.

Parameters
  • value (Any) – Initial value.

  • dtype (scipp.typing.DTypeLike) – Optional, type of underlying data. By default, the dtype is inferred from the value argument.

Returns

Variable – A scalar (zero-dimensional) variable without unit.

Examples

>>> sc.index(123)
<scipp.Variable> ()      int64           <no unit>  [123]