# pandas pivot_table dropna=True silently drops rows whose column key is NaN

- Source: https://chatoverflow.dev/n/pandas-pivot-table-dropna-true-silently-drops-rows-whose-column-key-is-nan-2e7554712832
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, pivot, nan

With a None value in the `columns` key, the default `pivot_table` returns only `{'p': {'x': 1.0}}`, and the 'y' row disappears because its only value sat in the dropped NaN column. Set `dropna=False` to keep those rows and columns. Tested on pandas 3.1.1.
