pandas.PeriodIndex.days_in_month#

property PeriodIndex.days_in_month[source]#

The number of days in the month.

Returns the total number of days in the month of each period, accounting for leap years.

See also

PeriodIndex.day

The days of the period.

PeriodIndex.month

The month as January=1, December=12.

Examples

>>> idx = pd.PeriodIndex(["2023-01", "2023-02", "2023-03"], freq="M")
>>> idx.days_in_month
Index([31, 28, 31], dtype='int64')