Creation functions#

array(*, dims, values[, variances, unit, dtype])

Constructs a Variable with given dimensions, containing given values and optional variances.

arange(dim, start[, stop, step, unit, dtype])

Constructs a Variable with evenly spaced values within a given interval.

datetime(value, *[, unit])

Constructs a zero dimensional Variable with a dtype of datetime64.

datetimes(*, dims, values[, unit])

Constructs an array Variable with a dtype of datetime64.

empty(*[, dims, shape, sizes, unit, dtype, ...])

Constructs a Variable with uninitialized values with given dimension labels and shape.

empty_like(var, /)

Constructs a new object with the same dims, shape, unit and dtype as the input (Variable or DataArray), but with all values uninitialized.

epoch(*, unit)

Constructs a zero dimensional Variable with a dtype of datetime64 that contains scipp's epoch.

full(*[, dims, shape, sizes, unit, dtype, ...])

Constructs a Variable with values initialized to the specified value with given dimension labels and shape.

full_like(var, /, value, *[, variance])

Constructs a new object with the same dims, shape, unit and dtype as the input (Variable or DataArray), but with all values, and optionally variances, initialized to the specified value and variance.

geomspace(dim, start, stop, num, *[, ...])

Constructs a Variable with values spaced evenly on a log scale (a geometric progression).

index(value[, dtype])

Constructs a zero dimensional Variable representing an index.

linspace(dim, start, stop, num, *[, ...])

Constructs a Variable with num evenly spaced samples, calculated over the interval [start, stop].

logspace(dim, start, stop, num, *[, ...])

Constructs a Variable with values spaced evenly on a log scale.

matrix(*[, unit])

Constructs a zero dimensional Variable holding a single 3x3 matrix.

matrices(*, dims[, unit])

Constructs a Variable with given dimensions holding an array of 3x3 matrices.

ones(*[, dims, shape, sizes, unit, dtype, ...])

Constructs a Variable with values initialized to 1 with given dimension labels and shape.

ones_like(var, /)

Constructs a new object with the same dims, shape, unit and dtype as the input (Variable or DataArray), but with all values initialized to 1.

scalar(value[, variance, unit, dtype])

Constructs a zero dimensional Variable with a unit and optional variance.

vector(*[, unit])

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

vectors(*, dims[, unit])

Constructs a Variable with given dimensions holding an array of length-3 vectors.

zeros(*[, dims, shape, sizes, unit, dtype, ...])

Constructs a Variable with default initialized values with given dimension labels and shape.

zeros_like(var, /)

Return a Variable or DataArray with the same dims, shape, unit, and dtype as the input and all values initialized to 0.