Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change default value of the
observed=
argument in groupby to True
…
… to reflect the actual behaviour (#13296) When grouping by a categorical, we default to the behaviour `observed=True`. I'm changing the value of the kwarg to reflect that: ```python In [43]: df = pd.DataFrame({'a': [1, 2, 3, 4]}) In [44]: idx = pd.CategoricalIndex([1, 1, 2, 3], categories=[1, 2, 3, 4, 5]) In [45]: df.groupby(idx).sum() Out[45]: a 1 3 2 3 3 4 4 0 5 0 In [46]: df.groupby(idx, observed=True).sum() Out[46]: a 1 3 2 3 3 4 In [47]: df = cudf.DataFrame({'a': [1, 2, 3, 4]}) In [48]: idx = cudf.CategoricalIndex([1, 1, 2, 3], categories=[1, 2, 3, 4, 5]) In [49]: df.groupby(idx).sum() Out[49]: a 1 3 3 4 2 3 ``` Authors: - Ashwin Srinath (https://github.com/shwina) Approvers: - Bradley Dice (https://github.com/bdice) URL: #13296
- Loading branch information