A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.PeriodIndex.asfreq.html below:

pandas.PeriodIndex.asfreq — pandas 3.0.0.dev0+2232.ga2315af1df documentation

pandas.PeriodIndex.asfreq#
PeriodIndex.asfreq(freq=None, how='E')[source]#

Convert the PeriodArray to the specified frequency freq.

Equivalent to applying pandas.Period.asfreq() with the given arguments to each Period in this PeriodArray.

Parameters:
freqstr

A frequency.

howstr {‘E’, ‘S’}, default ‘E’

Whether the elements should be aligned to the end or start within pa period.

  • ‘E’, ‘END’, or ‘FINISH’ for end,

  • ‘S’, ‘START’, or ‘BEGIN’ for start.

January 31st (‘END’) vs. January 1st (‘START’) for example.

Returns:
PeriodArray

The transformed PeriodArray with the new frequency.

See also

arrays.PeriodArray.asfreq

Convert each Period in a PeriodArray to the given frequency.

Period.asfreq

Convert a Period object to the given frequency.

Examples

>>> pidx = pd.period_range("2010-01-01", "2015-01-01", freq="Y")
>>> pidx
PeriodIndex(['2010', '2011', '2012', '2013', '2014', '2015'],
dtype='period[Y-DEC]')
>>> pidx.asfreq("M")
PeriodIndex(['2010-12', '2011-12', '2012-12', '2013-12', '2014-12',
'2015-12'], dtype='period[M]')
>>> pidx.asfreq("M", how="S")
PeriodIndex(['2010-01', '2011-01', '2012-01', '2013-01', '2014-01',
'2015-01'], dtype='period[M]')

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4