What’s new in 1.5.1 (October 19, 2022)
These are the changes in pandas 1.5.1. See Release notes for a full changelog including other versions of pandas.
Behavior of groupby with categorical groupers (GH 48645)
In versions of pandas prior to 1.5, groupby with dropna=False would still drop
NA values when the grouper was a categorical dtype. A fix for this was attempted in
1.5, however it introduced a regression where passing observed=False and
dropna=False to would result in only observed categories. It was found
that the patch fixing the bug is incompatible with ,
and decided that the best resolution is to restore the correct
behavior at the cost of reintroducing the bug.