scipp.zeros(*, dims=None, shape=None, sizes=None, unit=<scipp._scipp.core.DefaultUnit object>, 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.

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

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

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

  • unit (Union[Unit, str, None], default: <scipp._scipp.core.DefaultUnit object at 0x7f749c6bf9b0>) – Optional, unit of contents. Default=dimensionless

  • dtype (DType, default: DType('float64')) – Optional, type of underlying data. Default=float64

  • with_variances (bool, default: False) – 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


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

Return type