scipp.broadcast
scipp.broadcast#
- scipp.broadcast(x, dims=None, shape=None, sizes=None)#
Broadcast a Variable or a DataArray. If the input is a DataArray, coordinates and attributes are shallow-copied and masks are deep copied.
Note that scipp operations broadcast automatically, so using this function directly is rarely required.
- Parameters
x (
Union
[Variable
,DataArray
,Dataset
]) – Variable or DataArray to broadcast.dims (
Union
[List
[str
],Tuple
[str
,...
],None
], default:None
) – Optional (if sizes is specified), list of new dimensions.shape (
Optional
[Sequence
[int
]], default:None
) – Optional (if sizes is specified), new extents in each dimension.sizes (
Optional
[Dict
[str
,int
]], default:None
) – Optional, new dimension labels to sizes map.
- Returns
Variable
– New Variable or DataArray with requested dimension labels and shape.