pandas.Series.asfreq

pandas 3.1.1 · Series and accessors · method

Conform the object to a frequency. Use resample to aggregate observations into time bins.

Call syntax

Series.asfreq(freq, method=None, how=None, normalize=False, fill_value=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
freq Required
Positional or keyword
DateOffset or str

Specify the frequency or offset, such as "D" for a day or "MS" for a calendar month start.

method Optional
Positional or keyword
Default None
{'backfill'/'bfill', 'pad'/'ffill'}

Choose the algorithm used to calculate, align, or fill the result.

how Optional
Positional or keyword
Default None
{'end', 'start', 'e', 's'}

Choose a policy such as a join type or a missing-value removal rule.

normalize Optional
Positional or keyword
Default False
bool

Request normalized output, such as proportions for counts or midnight for datetimes.

fill_value Optional
Positional or keyword
Default None
scalar

Supply a value to use in place of a missing position.

Returns

Series/DataFrame