Skip to content

Commit e902764

Browse files
janellejorisvandenbossche
authored andcommitted
DOC: update the pandas.Series.dt.is_month_end docstring (#20181)
1 parent 13ae107 commit e902764

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

pandas/core/indexes/datetimes.py

+35-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,41 @@ def freq(self, value):
17731773
is_month_end = _field_accessor(
17741774
'is_month_end',
17751775
'is_month_end',
1776-
"Logical indicating if last day of month (defined by frequency)")
1776+
"""
1777+
Indicator for whether the date is the last day of the month.
1778+
1779+
Returns
1780+
-------
1781+
Series or array
1782+
For Series, returns a Series with boolean values. For
1783+
DatetimeIndex, returns a boolean array.
1784+
1785+
See Also
1786+
--------
1787+
is_month_start : Indicator for whether the date is the first day
1788+
of the month.
1789+
1790+
Examples
1791+
--------
1792+
This method is available on Series with datetime values under
1793+
the ``.dt`` accessor, and directly on DatetimeIndex.
1794+
1795+
>>> dates = pd.Series(pd.date_range("2018-02-27", periods=3))
1796+
>>> dates
1797+
0 2018-02-27
1798+
1 2018-02-28
1799+
2 2018-03-01
1800+
dtype: datetime64[ns]
1801+
>>> dates.dt.is_month_end
1802+
0 False
1803+
1 True
1804+
2 False
1805+
dtype: bool
1806+
1807+
>>> idx = pd.date_range("2018-02-27", periods=3)
1808+
>>> idx.is_month_end
1809+
array([False, True, False], dtype=bool)
1810+
""")
17771811
is_quarter_start = _field_accessor(
17781812
'is_quarter_start',
17791813
'is_quarter_start',

0 commit comments

Comments
 (0)