我正在尝试合并到具有相同结构的xarray数据集:
<xarray.DataArray 'frac' (lat: 53, lon: 178)>
dask.array<shape=(53, 178), dtype=float64, chunksize=(50, 50)>
Coordinates:
* lat (lat) float64 -23.0 -22.75 -22.5 -22.25 -22.0 -21.75 -21.5 ...
* lon (lon) float64 112.0 112.2 112.5 112.8 113.0 113.2 113.5 113.8 ...
我希望将这些合并到一个名为“ month”的新维度中,这样看起来像这样:
Dimensions: (lat: 53, lon: 178, month: 2)
Coordinates:
* lon (lon) float64 112.0 112.2 112.5 112.8 113.0 113.2 113.5 113.8 ...
* lat (lat) float64 -23.0 -22.75 -22.5 -22.25 -22.0 -21.75 -21.5 ...
* month (month) int64 10 11
答案 0 :(得分:0)
请参见here如何组合数据数组:
da_concat = xr.concat([da0, da1], pd.Index([10, 11], name='month'))