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

Constructs a Variable with default initialized values with given dimension labels and shape. The dims and shape can also be specified using a sizes dict. Optionally can add default initialized variances. Only keyword arguments accepted.


scipp.ones() scipp.empty() scipp.scalar() scipp.array()

  • 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, imension 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 variances initialized to the default value for dtype. For example for a float type values and variances would all be initialized to 0.0. Default=False

Return type