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

Constructs a Variable with values initialized to 1 with given dimension labels and shape. The dims and shape can also be specified using a sizes dict.


scipp.zeros() 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, 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 variances initialized to 1. Default=False

Return type