在下面的示例中,是否有理由对数据集重新采样会更改维度的顺序?我期望dataset.resample
和dataarray.resample
da = xr.DataArray(np.random.rand(3, 3, 100),
coords={'time': pd.date_range('01/01/2000', periods=100, freq=pd.DateOffset(hours=1))},
dims=['lat', 'lon', 'time'])
ds = xr.merge([da.rename('var1'), da.rename('var2')])
print(ds.var1.shape)
print(ds.var1.resample(time='3h').asfreq().shape)
print(ds.resample(time='3h').asfreq().var1.shape)
输出:
(3, 3, 100)
(3, 3, 34)
(34, 3, 3)