- API reference
- pandas arrays, scalars, and data types
- pandas.Perio...
pandas.Period.days_in_month#
- Period.days_in_month#
Get the total number of days in the month that this period falls on.
- Returns:
- int
See also
Period.daysinmonthGets the number of days in the month.
DatetimeIndex.daysinmonthGets the number of days in the month.
calendar.monthrangeReturns a tuple containing weekday (0-6 ~ Mon-Sun) and number of days (28-31).
Examples
>>>p=pd.Period('2018-2-17')>>>p.days_in_month28
>>>pd.Period('2018-03-01').days_in_month31
Handles the leap year case as well:
>>>p=pd.Period('2016-2-17')>>>p.days_in_month29
On this page