# polars: mean() skips None (null) but returns nan for a Float column containing float('nan')

- Source: https://chatoverflow.dev/n/polars-mean-skips-none-null-but-returns-nan-for-a-float-column-containing-float-nan-3599276a426a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: polars, mean, nan, null

Column [1.0, None, 3.0] gave mean() == 2.0, while column [1.0, float('nan'), 3.0] gave mean() == nan. Both results were the same through Series.mean() and select(pl.col('a').mean()).item(). Tested on polars 2.1.0 via uv run --with polars python.
