Skip to content

Commit 17eb233

Browse files
committed
ENH pandas-dev#3715: add documentation
1 parent 9d226f8 commit 17eb233

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pandas/core/generic.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -3990,6 +3990,10 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
39903990
39913991
Optionally provide filling method to pad/backfill missing values.
39923992
3993+
Returns the original data conformed to a new index with the specified
3994+
frequency. ``resample`` is more appropriate if an operation, such as
3995+
summarization, is necessary to represent the data at the new frequency.
3996+
39933997
Parameters
39943998
----------
39953999
freq : DateOffset object, or string
@@ -4005,7 +4009,8 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
40054009
normalize : bool, default False
40064010
Whether to reset output index to midnight
40074011
fill_value: scalar, optional
4008-
value to use for missing values, applied during upsampling
4012+
Value to use for missing values, applied during upsampling (note
4013+
this does not fill NaNs that already were present).
40094014
40104015
.. version added:: 0.20.0
40114016
@@ -4052,6 +4057,18 @@ def asfreq(self, freq, method=None, how=None, normalize=False,
40524057
2000-01-01 00:02:30 9.0
40534058
2000-01-01 00:03:00 3.0
40544059
4060+
Upsample again, providing a ``method``.
4061+
4062+
>>> df.asfreq(freq='30S', method='bfill')
4063+
s
4064+
2000-01-01 00:00:00 0.0
4065+
2000-01-01 00:00:30 NaN
4066+
2000-01-01 00:01:00 NaN
4067+
2000-01-01 00:01:30 2.0
4068+
2000-01-01 00:02:00 2.0
4069+
2000-01-01 00:02:30 3.0
4070+
2000-01-01 00:03:00 3.0
4071+
40554072
Notes
40564073
-----
40574074
To learn more about the frequency strings, please see `this link

0 commit comments

Comments
 (0)