From 61c3f14c0b58dbc74cdd56af8de39815e9c0d7fb Mon Sep 17 00:00:00 2001 From: Janelle Date: Sat, 10 Mar 2018 15:03:16 +0100 Subject: [PATCH 1/5] DOC: improved the docstring of pandas.Series.dt.is_month_first --- pandas/core/indexes/datetimes.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index e5e9bba269fd4..434a0600f12f0 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1727,7 +1727,32 @@ def freq(self, value): is_month_start = _field_accessor( 'is_month_start', 'is_month_start', - "Logical indicating if first day of month (defined by frequency)") + """ + Returns a boolean indicating if the date is the first day of the month. + + Returns + ------- + is_month_start : Series of boolean + + See Also + -------- + is_month_end : Returns a boolean indicating if the date is the last day of the month. + + Examples + -------- + >>> import pandas as pd + >>> dates = pd.Series(pd.date_range("2018-02-27", periods = 3)) + >>> dates + 0 2018-02-27 + 1 2018-02-28 + 2 2018-03-01 + dtype: datetime64[ns] + >>> dates.dt.is_month_start + 0 False + 1 False + 2 True + dtype: bool + """) is_month_end = _field_accessor( 'is_month_end', 'is_month_end', From 7840d520c1fdaffcad1ca3918540b06dacecbfff Mon Sep 17 00:00:00 2001 From: Janelle Date: Sat, 10 Mar 2018 15:05:41 +0100 Subject: [PATCH 2/5] minor languague style change in the description --- pandas/core/indexes/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 434a0600f12f0..68fbc809a54a5 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1728,7 +1728,7 @@ def freq(self, value): 'is_month_start', 'is_month_start', """ - Returns a boolean indicating if the date is the first day of the month. + Return a boolean indicating if the date is the first day of the month. Returns ------- From 8f8c65603a6ecc2850cf4618e865c7da0af3580e Mon Sep 17 00:00:00 2001 From: Janelle Date: Sat, 10 Mar 2018 15:35:20 +0100 Subject: [PATCH 3/5] cropped lines at 80 characters, removed importing pandas, pep8styling --- pandas/core/indexes/datetimes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 68fbc809a54a5..f670d2869afc3 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1736,12 +1736,12 @@ def freq(self, value): See Also -------- - is_month_end : Returns a boolean indicating if the date is the last day of the month. + is_month_end : Returns a boolean indicating if the date is the last day + of the month. Examples -------- - >>> import pandas as pd - >>> dates = pd.Series(pd.date_range("2018-02-27", periods = 3)) + >>> dates = pd.Series(pd.date_range("2018-02-27", periods=3)) >>> dates 0 2018-02-27 1 2018-02-28 From 768f2e5b4348dbddd734395be34df9de211458d0 Mon Sep 17 00:00:00 2001 From: Janelle Date: Sat, 10 Mar 2018 15:40:19 +0100 Subject: [PATCH 4/5] see also description indentation --- pandas/core/indexes/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index f670d2869afc3..5f3a5225806fc 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1736,8 +1736,8 @@ def freq(self, value): See Also -------- - is_month_end : Returns a boolean indicating if the date is the last day - of the month. + is_month_end : Returns a boolean indicating if the date is the last day + of the month. Examples -------- From 5227cad133e2ccb31330d38dc5910dd723fa3be6 Mon Sep 17 00:00:00 2001 From: Janelle Date: Sat, 10 Mar 2018 16:01:11 +0100 Subject: [PATCH 5/5] line length reduced --- pandas/core/indexes/datetimes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 5f3a5225806fc..11506a69625c3 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1728,16 +1728,16 @@ def freq(self, value): 'is_month_start', 'is_month_start', """ - Return a boolean indicating if the date is the first day of the month. + Return a boolean indicating whether the date is the first day of the month. Returns ------- - is_month_start : Series of boolean + is_month_start : Series of boolean. See Also -------- - is_month_end : Returns a boolean indicating if the date is the last day - of the month. + is_month_end : Return a boolean indicating whether the date is + the last day of the month. Examples --------