xarray_einstats.einops.raw_rearrange#
- xarray_einstats.einops.raw_rearrange(da, pattern, **kwargs)[source]#
Crudely wrap einops.rearrange.
Wrapper around einops.rearrange with a very similar syntax. Spaces, parenthesis
()
and->
are not allowed in dimension names.- Parameters
- da
xarray.DataArray
Input array
- pattern
str
Pattern string. Same syntax as patterns in einops with two caveats:
Unless splitting or stacking, you must use the actual dimension names.
When splitting or stacking you can use
(dim1 dim2)=dim
. This isnecessary
for the left hand side as it identifies the dimension to split, and optional on the right hand side, if omitted the stacked dimension will be given a default name.
- kwargs
dict
, optional Passed to
xarray_einstats.einops.rearrange
- da
- Returns
See also
xarray_einstats.einops.rearrange
More flexible and powerful wrapper over einops.rearrange. It is also more verbose.