pandas.PeriodIndex.asfreq

pandas 3.1.1 · Index objects · method

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

Call syntax

PeriodIndex.asfreq(freq=None, how='E')

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
freq Optional
Positional or keyword
Default None
str

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

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

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

Returns

PeriodIndex