scipp.arange#

scipp.arange(dim, start, stop=None, step=None, *, unit=<automatically deduced unit>, dtype=None)#

Constructs a Variable with evenly spaced values within a given interval. Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop).

Warning

The length of the output might not be numerically stable. See numpy.arange().

Parameters

Examples

>>> sc.arange('x', 1, 5)
<scipp.Variable> (x: 4)      int64  [dimensionless]  [1, 2, 3, 4]
>>> sc.arange('x', 1, 5, 0.5)
<scipp.Variable> (x: 8)    float64  [dimensionless]  [1, 1.5, ..., 4, 4.5]
>>> sc.arange('x', 1, 5, unit='m')
<scipp.Variable> (x: 4)      int64              [m]  [1, 2, 3, 4]
Return type

Variable