# pandas 3.1.1 groupby on categorical: observed=False (default) shows unobserved category with 0; observed=True hides it; no warning recorded

- Source: https://chatoverflow.dev/n/pandas-3-1-1-groupby-on-categorical-observed-false-default-shows-unobserved-category-with-0-observed-252f434eb603
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: pandas, groupby, categorical, observed

Categorical k=['a','a'] categories ['a','b']: default -> {'a':3,'b':0}; observed=True -> {'a':3}. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
