cudf.core.series.DatetimeProperties.is_leap_year#

property DatetimeProperties.is_leap_year: Series[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 with the exception of years divisible by 100 but not by 400.

Returns:
Series
Booleans indicating if dates belong to a leap year.

Examples

>>> import pandas as pd, cudf
>>> s = cudf.Series(
...     pd.date_range(start='2000-02-01', end='2013-02-01', freq='1Y'))
>>> s
0    2000-12-31
1    2001-12-31
2    2002-12-31
3    2003-12-31
4    2004-12-31
5    2005-12-31
6    2006-12-31
7    2007-12-31
8    2008-12-31
9    2009-12-31
10   2010-12-31
11   2011-12-31
12   2012-12-31
dtype: datetime64[ns]
>>> s.dt.is_leap_year
0      True
1     False
2     False
3     False
4      True
5     False
6     False
7     False
8      True
9     False
10    False
11    False
12     True
dtype: bool