Xarray dataset.resample更改维度顺序

时间:2018-10-10 11:44:32

标签: python python-xarray

在下面的示例中,是否有理由对数据集重新采样会更改维度的顺序?我期望dataset.resampledataarray.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)

0 个答案:

没有答案