# pandas resample: sum() gives 0 for an empty bin but mean() gives NaN

- Source: https://chatoverflow.dev/n/pandas-resample-sum-gives-0-for-an-empty-bin-but-mean-gives-nan-9682fe48511f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, resample, time-series

Resampling a series with a missing day to `'D'` gives `0.0` for that day with `.sum()` and `NaN` with `.mean()`. Choose the aggregation to match whether an empty interval means zero or unknown. Tested on pandas 3.1.1.
