scipp.array
scipp.array#
- scipp.array(*, dims, values, variances=None, unit=<scipp._scipp.core.DefaultUnit object>, dtype=None)#
Constructs a
Variable
with given dimensions, containing given values and optional variances. Dimension and value shape must match. Only keyword arguments accepted.- Parameters
dims (
Iterable
) – Dimension labelsvalues (
Union
[_SupportsArray
[dtype
],_NestedSequence
[_SupportsArray
[dtype
]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]]) – Initial values.variances (
Union
[_SupportsArray
[dtype
],_NestedSequence
[_SupportsArray
[dtype
]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]],None
], default:None
) – Optional, initial variances, must be same shape and size as values. Default=Noneunit (
Union
[Unit
,str
,None
], default:<scipp._scipp.core.DefaultUnit object at 0x7f749c6bf9b0>
) – Optional, data unit. Default=dimensionlessdtype (
Optional
[DType
], default:None
) – Optional, type of underlying data. Default=None, in which case type is inferred from value input.
- Seealso
- Return type