pandas.Period.is_leap_year#
- Period.is_leap_year#
Return True if the period’s year is in a leap year.
A leap year is a year with 366 days (instead of 365), including February 29 as an intercalary day. Leap years are years divisible by 4, except for years divisible by 100 but not by 400.
See also
Timestamp.is_leap_yearCheck if the year in a Timestamp is a leap year.
DatetimeIndex.is_leap_yearBoolean indicator if the date belongs to a leap year.
Examples
>>> period = pd.Period('2022-01', 'M') >>> period.is_leap_year False
>>> period = pd.Period('2020-01', 'M') >>> period.is_leap_year True