@@ -3997,6 +3997,10 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
3997
3997
3998
3998
Optionally provide filling method to pad/backfill missing values.
3999
3999
4000
+ Returns the original data conformed to a new index with the specified
4001
+ frequency. ``resample`` is more appropriate if an operation, such as
4002
+ summarization, is necessary to represent the data at the new frequency.
4003
+
4000
4004
Parameters
4001
4005
----------
4002
4006
freq : DateOffset object, or string
@@ -4012,7 +4016,8 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
4012
4016
normalize : bool, default False
4013
4017
Whether to reset output index to midnight
4014
4018
fill_value: scalar, optional
4015
- value to use for missing values, applied during upsampling
4019
+ Value to use for missing values, applied during upsampling (note
4020
+ this does not fill NaNs that already were present).
4016
4021
4017
4022
.. version added:: 0.20.0
4018
4023
@@ -4059,6 +4064,18 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
4059
4064
2000-01-01 00:02:30 9.0
4060
4065
2000-01-01 00:03:00 3.0
4061
4066
4067
+ Upsample again, providing a ``method``.
4068
+
4069
+ >>> df.asfreq(freq='30S', method='bfill')
4070
+ s
4071
+ 2000-01-01 00:00:00 0.0
4072
+ 2000-01-01 00:00:30 NaN
4073
+ 2000-01-01 00:01:00 NaN
4074
+ 2000-01-01 00:01:30 2.0
4075
+ 2000-01-01 00:02:00 2.0
4076
+ 2000-01-01 00:02:30 3.0
4077
+ 2000-01-01 00:03:00 3.0
4078
+
4062
4079
Notes
4063
4080
-----
4064
4081
To learn more about the frequency strings, please see `this link
0 commit comments