pandas.Series.dt.days_in_month#

Series.dt.days_in_month[source] #

The number of days in the month.

See also

Series.dt.day

Return the day of the month.

Series.dt.is_month_end

Return a boolean indicating if the date is the last day of the month.

Series.dt.is_month_start

Return a boolean indicating if the date is the first day of the month.

Series.dt.month

Return the month as January=1 through December=12.

Examples

>>> s = pd.Series(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"])
>>> s = pd.to_datetime(s)
>>> s
0 2020年01月01日 10:00:00+00:00
1 2020年02月01日 11:00:00+00:00
dtype: datetime64[s, UTC]
>>> s.dt.daysinmonth
0 31
1 29
dtype: int32

This Page