A RetroSearch Logo

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

Search Query:

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

pandas.PeriodIndex.days_in_month — pandas 2.3.1 documentation

pandas.PeriodIndex.days_in_month#
property PeriodIndex.days_in_month[source]#

The number of days in the month.

Examples

For Series:

>>> period = pd.period_range('2020-1-1 00:00', '2020-3-1 00:00', freq='M')
>>> s = pd.Series(period)
>>> s
0   2020-01
1   2020-02
2   2020-03
dtype: period[M]
>>> s.dt.days_in_month
0    31
1    29
2    31
dtype: int64

For PeriodIndex:

>>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
>>> idx.days_in_month   # It can be also entered as `daysinmonth`
Index([31, 28, 31], dtype='int64')

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