File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -1859,7 +1859,46 @@ def freq(self, value):
1859
1859
is_year_start = _field_accessor (
1860
1860
'is_year_start' ,
1861
1861
'is_year_start' ,
1862
- "Logical indicating if first day of year (defined by frequency)" )
1862
+ """
1863
+ Indicate whether the date is the first day of a year.
1864
+
1865
+ Returns
1866
+ -------
1867
+ Series or DatetimeIndex
1868
+ The same type as the original data with boolean values. Series will
1869
+ have the same name and index. DatetimeIndex will have the same
1870
+ name.
1871
+
1872
+ See Also
1873
+ --------
1874
+ is_year_end : Similar method indicating the last day of the year.
1875
+
1876
+ Examples
1877
+ --------
1878
+ This method is available on Series with datetime values under
1879
+ the ``.dt`` accessor, and directly on DatetimeIndex.
1880
+
1881
+ >>> dates = pd.Series(pd.date_range("2017-12-30", periods=3))
1882
+ >>> dates
1883
+ 0 2017-12-30
1884
+ 1 2017-12-31
1885
+ 2 2018-01-01
1886
+ dtype: datetime64[ns]
1887
+
1888
+ >>> dates.dt.is_year_start
1889
+ 0 False
1890
+ 1 False
1891
+ 2 True
1892
+ dtype: bool
1893
+
1894
+ >>> idx = pd.date_range("2017-12-30", periods=3)
1895
+ >>> idx
1896
+ DatetimeIndex(['2017-12-30', '2017-12-31', '2018-01-01'],
1897
+ dtype='datetime64[ns]', freq='D')
1898
+
1899
+ >>> idx.is_year_start
1900
+ array([False, False, True])
1901
+ """ )
1863
1902
is_year_end = _field_accessor (
1864
1903
'is_year_end' ,
1865
1904
'is_year_end' ,
You can’t perform that action at this time.
0 commit comments