This seems to be working:
ds2 = ds.copy(deep=True)
ds2["time"] =
pd.MultiIndex.from_arrays(np.divmod(np.arange(ds.sizes["time"]),
10))
ds2.unstack("time")
I think we should add `.coarsen.construct()` because this does exactly what you want:
reshaped, _ = ds.air.variable._coarsen_reshape(boundary="trim", side="left", windows={"time": 10})
and it would nicely mirror the `rolling.construct()` API. Can you
open an issue for this please?
Deepak
--
You received this message because you are subscribed to the Google Groups "xarray" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xarray+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xarray/88fe43c8-6fac-4995-8d9b-7fd8a0ad9f8an%40googlegroups.com.