-
Hi team,
And i want to calculate rolling Standard Deviation along 'X' axis.
Along each 'Y' axis, i will receive one result, but that is not what i want. Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for writing out the example @babameme .
In [21]: X.stack(z=['X','Y']).rolling(z=3*4).std()[::4]
Out[21]:
<xarray.DataArray (z: 12)>
array([ nan, nan, nan, 3.45205253, 3.45205253,
3.45205253, 3.45205253, 3.45205253, 3.45205253, 3.45205253,
3.45205253, 3.45205253])
Coordinates:
* z (z) MultiIndex
- X (z) int64 0 1 2 3 4 5 6 7 8 9 10 11
- Y (z) int64 0 0 0 0 0 0 0 0 0 0 0 0 |
Beta Was this translation helpful? Give feedback.
Thanks for writing out the example @babameme .
There may be a creative way to do this, but there isn't a multi-d rolling aggregation in xarray. The best I've come up with is this workaround:(Edit: this is wrong!! See @dcherian 's answer below)