- API reference
- pandas arrays, scalars, and data types
- pandas.Period.asfreq
pandas.Period.asfreq#
- Period.asfreq(freq,how='E')#
Convert Period to desired frequency, at the start or end of the interval.
- Parameters:
- freqstr, BaseOffset
The desired frequency. If passing astr, it needs to be avalidperiod alias.
- how{‘E’, ‘S’, ‘end’, ‘start’}, default ‘end’
Start or end of the timespan.
- Returns:
- resampledPeriod
Examples
>>>period=pd.Period('2023-1-1',freq='D')>>>period.asfreq('h')Period('2023-01-01 23:00', 'h')
On this page