Python xarray:按多个参数分组

Python xarray: grouping by multiple parameters

在 Python 2.7 中使用 xarray 包时,是否可以像在 pandas 中那样对多个参数进行分组?本质上,这样的操作:

data.groupby(['time.year','time.month']).mean()

如果您想获取数据集每年和每月的平均值。

遗憾的是,xarray 尚不支持使用多个参数进行分组。这是 something we would like to support,它会相对简单,但还没有人有时间实现它(欢迎贡献!)。