Skip to content

Commit 61c3f14

Browse files
committed
DOC: improved the docstring of pandas.Series.dt.is_month_first
1 parent 4131149 commit 61c3f14

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

pandas/core/indexes/datetimes.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,32 @@ def freq(self, value):
17271727
is_month_start = _field_accessor(
17281728
'is_month_start',
17291729
'is_month_start',
1730-
"Logical indicating if first day of month (defined by frequency)")
1730+
"""
1731+
Returns a boolean indicating if the date is the first day of the month.
1732+
1733+
Returns
1734+
-------
1735+
is_month_start : Series of boolean
1736+
1737+
See Also
1738+
--------
1739+
is_month_end : Returns a boolean indicating if the date is the last day of the month.
1740+
1741+
Examples
1742+
--------
1743+
>>> import pandas as pd
1744+
>>> dates = pd.Series(pd.date_range("2018-02-27", periods = 3))
1745+
>>> dates
1746+
0 2018-02-27
1747+
1 2018-02-28
1748+
2 2018-03-01
1749+
dtype: datetime64[ns]
1750+
>>> dates.dt.is_month_start
1751+
0 False
1752+
1 False
1753+
2 True
1754+
dtype: bool
1755+
""")
17311756
is_month_end = _field_accessor(
17321757
'is_month_end',
17331758
'is_month_end',

0 commit comments

Comments
 (0)