scipp.empty

scipp.empty

scipp.empty(*, dims=None, shape=None, sizes=None, unit=dimensionless, dtype=DType('float64'), with_variances=False)

Constructs a Variable with uninitialized values with given dimension labels and shape. The dims and shape can also be specified using a sizes dict. USE WITH CARE! Uninitialized means that values have undetermined values. Consider using scipp.zeros() unless you know what you are doing and require maximum performance.

Seealso

scipp.zeros() scipp.ones() scipp.scalar() scipp.array()

Parameters
  • dims (Optional[Sequence[str]]) – Optional (if sizes is specified), dimension labels.

  • shape (Optional[Sequence[int]]) – Optional (if sizes is specified), dimension sizes.

  • sizes (Optional[dict]) – Optional, dimension label to size map.

  • unit (Union[scipp._scipp.core.Unit, str]) – Optional, unit of contents. Default=dimensionless

  • dtype (scipp._scipp.core.DType) – Optional, type of underlying data. Default=float64

  • with_variances (bool) – Optional, boolean flag, if True includes uninitialized variances. Default=False

Return type

scipp._scipp.core.Variable