-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
API DesignDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateResampleresample methodresample method
Milestone
Description
see also #3707
Add a fill_value option to resample() so that it is possible to resample a TimeSeries without creating NaN values. If the series is an int dtype and an int is passed to fill_value, it should be possible to resample the series without casting the values to floats.
>>> dates = (datetime(2013, 1, 1), datetime(2013,1,2), datetime(2013,3,1)) >>> s = Series([1,2,4],index=dates) >>> s 2013-01-01 1 2013-01-02 2 2013-03-01 4 dtype: int64 >>> s.resample('M', how='sum') 2013-01-31 3 2013-02-28 NaN 2013-03-31 4 Freq: M, dtype: float64 >>> s.resample('M', how='sum', fill_value=0) 2013-01-31 3 2013-02-28 0 2013-03-31 4 Freq: M, dtype: int64 Metadata
Metadata
Assignees
Labels
API DesignDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateResampleresample methodresample method