@@ -4061,6 +4061,10 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
4061
4061
4062
4062
Optionally provide filling method to pad/backfill missing values.
4063
4063
4064
+ Returns the original data conformed to a new index with the specified
4065
+ frequency. ``resample`` is more appropriate if an operation, such as
4066
+ summarization, is necessary to represent the data at the new frequency.
4067
+
4064
4068
Parameters
4065
4069
----------
4066
4070
freq : DateOffset object, or string
@@ -4076,7 +4080,8 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
4076
4080
normalize : bool, default False
4077
4081
Whether to reset output index to midnight
4078
4082
fill_value: scalar, optional
4079
- value to use for missing values, applied during upsampling
4083
+ Value to use for missing values, applied during upsampling (note
4084
+ this does not fill NaNs that already were present).
4080
4085
4081
4086
.. version added:: 0.20.0
4082
4087
@@ -4123,6 +4128,18 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
4123
4128
2000-01-01 00:02:30 9.0
4124
4129
2000-01-01 00:03:00 3.0
4125
4130
4131
+ Upsample again, providing a ``method``.
4132
+
4133
+ >>> df.asfreq(freq='30S', method='bfill')
4134
+ s
4135
+ 2000-01-01 00:00:00 0.0
4136
+ 2000-01-01 00:00:30 NaN
4137
+ 2000-01-01 00:01:00 NaN
4138
+ 2000-01-01 00:01:30 2.0
4139
+ 2000-01-01 00:02:00 2.0
4140
+ 2000-01-01 00:02:30 3.0
4141
+ 2000-01-01 00:03:00 3.0
4142
+
4126
4143
Notes
4127
4144
-----
4128
4145
To learn more about the frequency strings, please see `this link
0 commit comments