diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index e8e2f1b08d4..4c98ea90389 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -519,6 +519,7 @@ def apply(self, func, shortcut=False, args=(), **kwargs): Apply uses heuristics (like `pandas.GroupBy.apply`) to figure out how to stack together the array. The rule is: + 1. If the dimension along which the group coordinate is defined is still in the first grouped array after applying `func`, then stack over this dimension. @@ -661,6 +662,7 @@ def apply(self, func, args=(), **kwargs): Apply uses heuristics (like `pandas.GroupBy.apply`) to figure out how to stack together the datasets. The rule is: + 1. If the dimension along which the group coordinate is defined is still in the first grouped item after applying `func`, then stack over this dimension.