modin.pandas.DatetimeIndex.is_leap_year

property DatetimeIndex.is_leap_year: Index[source]

Boolean indicator if the date belongs to a leap year.

A leap year is a year, which has 366 days (instead of 365) including 29th of February as an intercalary day. Leap years are years which are multiples of four except for years divisible by 100 but not by 400.

Returns:

  • An Index with boolean values. Note this is different from native pandas which

  • returns a python array.

Examples

>>> idx = pd.date_range("2012-01-01", "2015-01-01", freq="YE")
>>> idx
DatetimeIndex(['2012-12-31', '2013-12-31', '2014-12-31'], dtype='datetime64[ns]', freq=None)
>>> idx.is_leap_year
Index([True, False, False], dtype='bool')
Copy