You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOC: Document preservation of boolean dtype in pivot_table and unstack
- Added release note to v3.0.0.rst under Enhancements and Bug fixes, describing that boolean columns are now preserved as nullable BooleanDtype in pivoting and unstacking operations, with missing values as pd.NA.
- References issue #62244.
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v3.0.0.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,7 @@ Other enhancements
163
163
- :class:`pandas.api.typing.SASReader` is available for typing the output of :func:`read_sas` (:issue:`55689`)
164
164
- Added :meth:`.Styler.to_typst` to write Styler objects to file, buffer or string in Typst format (:issue:`57617`)
165
165
- Added missing :meth:`pandas.Series.info` to API reference (:issue:`60926`)
166
+
- Pivoting or unstacking boolean columns (e.g., with :meth:`DataFrame.pivot_table`, :meth:`DataFrame.unstack`) now preserves them as nullable BooleanDtype, with missing values as ``pd.NA`` for improved memory usage and correctness. (:issue:`62244`)
166
167
- :class:`pandas.api.typing.NoDefault` is available for typing ``no_default``
167
168
- :func:`DataFrame.to_excel` now raises an ``UserWarning`` when the character count in a cell exceeds Excel's limitation of 32767 characters (:issue:`56954`)
168
169
- :func:`pandas.merge` now validates the ``how`` parameter input (merge type) (:issue:`59435`)
@@ -292,6 +293,7 @@ These improvements also fixed certain bugs in groupby:
292
293
- :meth:`.DataFrameGroupBy.nunique` would fail when there are multiple groupings, unobserved groups, and ``as_index=False`` (:issue:`52848`)
293
294
- :meth:`.DataFrameGroupBy.sum` would have incorrect values when there are multiple groupings, unobserved groups, and non-numeric data (:issue:`43891`)
294
295
- :meth:`.DataFrameGroupBy.value_counts` would produce incorrect results when used with some categorical and some non-categorical groupings and ``observed=False`` (:issue:`56016`)
296
+
- Fixed boolean columns being upcast to float or object in :meth:`DataFrame.pivot_table` and :meth:`DataFrame.unstack`; these now remain as nullable BooleanDtype with missing values as ``pd.NA``. (:issue:`62244`)
0 commit comments