From 808254bd8db6c8ea060214e4d30f1966c629ca58 Mon Sep 17 00:00:00 2001 From: pmhatre1 Date: Sat, 9 Mar 2024 11:37:09 -0700 Subject: [PATCH 1/5] Updated the pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring. --- ci/code_checks.sh | 2 -- pandas/core/arrays/datetimes.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c4e43b88a0097..337cd0a498bc9 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,8 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.dt.round\ pandas.Series.dt.floor\ pandas.Series.dt.ceil\ - pandas.Series.dt.month_name\ - pandas.Series.dt.day_name\ pandas.Series.cat.rename_categories\ pandas.Series.cat.reorder_categories\ pandas.Series.cat.add_categories\ diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 931f19a7901bd..7c00321f386b1 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1278,6 +1278,9 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the month names with specified locale. + This function returns the names of months corresponding to the datetime values in a DatetimeIndex object, + with the option to specify a locale for the language. + Parameters ---------- locale : str, optional @@ -1291,6 +1294,10 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]: Series or Index Series or Index of month names. + See Also + -------- + Series.dt.day_name: Return the day names of a datetime Series. + Examples -------- >>> s = pd.Series(pd.date_range(start="2018-01", freq="ME", periods=3)) @@ -1335,6 +1342,9 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the day names with specified locale. + This function returns the names of days corresponding to the datetime values in a DatetimeIndex object, + with the option to specify a locale for the language. + Parameters ---------- locale : str, optional @@ -1348,6 +1358,10 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]: Series or Index Series or Index of day names. + See Also + -------- + Series.dt.month_name: Return the month names of a datetime Series. + Examples -------- >>> s = pd.Series(pd.date_range(start="2018-01-01", freq="D", periods=3)) From 9d02b37d502b084c8d6cbcccd457b93350a355f2 Mon Sep 17 00:00:00 2001 From: pmhatre1 Date: Sat, 9 Mar 2024 12:46:39 -0700 Subject: [PATCH 2/5] Updated the pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring. --- pandas/core/arrays/datetimes.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 7c00321f386b1..b24fcabded53a 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1278,8 +1278,7 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the month names with specified locale. - This function returns the names of months corresponding to the datetime values in a DatetimeIndex object, - with the option to specify a locale for the language. + This function returns names of months corresponding to the datetime values in DatetimeIndex object. Parameters ---------- @@ -1342,8 +1341,7 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the day names with specified locale. - This function returns the names of days corresponding to the datetime values in a DatetimeIndex object, - with the option to specify a locale for the language. + This function returns names of days corresponding to the datetime values in DatetimeIndex object. Parameters ---------- From 824369cc572b0dc963b0b88e91f0b867e453fcef Mon Sep 17 00:00:00 2001 From: pmhatre1 Date: Sat, 9 Mar 2024 13:03:51 -0700 Subject: [PATCH 3/5] Updated the pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring. --- pandas/core/arrays/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index b24fcabded53a..24cdd0247d2c8 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1278,7 +1278,7 @@ def month_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the month names with specified locale. - This function returns names of months corresponding to the datetime values in DatetimeIndex object. + This function returns names of months corresponding to the datetime values. Parameters ---------- @@ -1341,7 +1341,7 @@ def day_name(self, locale=None) -> npt.NDArray[np.object_]: """ Return the day names with specified locale. - This function returns names of days corresponding to the datetime values in DatetimeIndex object. + This function returns names of days corresponding to the datetime values. Parameters ---------- From 871841fb6168266fc763d7a3327850e18052b5e7 Mon Sep 17 00:00:00 2001 From: pmhatre1 Date: Sat, 9 Mar 2024 17:13:26 -0700 Subject: [PATCH 4/5] pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring not there in GLO8 in code_checks --- ci/code_checks.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 337cd0a498bc9..c4e43b88a0097 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,6 +79,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.dt.round\ pandas.Series.dt.floor\ pandas.Series.dt.ceil\ + pandas.Series.dt.month_name\ + pandas.Series.dt.day_name\ pandas.Series.cat.rename_categories\ pandas.Series.cat.reorder_categories\ pandas.Series.cat.add_categories\ From 26dde033c401307613ca384538885159eb01ff92 Mon Sep 17 00:00:00 2001 From: pmhatre1 Date: Sat, 9 Mar 2024 18:15:51 -0700 Subject: [PATCH 5/5] pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring not there in GLO8 in code_checks. Removed from PR02 but error thrown while push. --- ci/code_checks.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c4e43b88a0097..337cd0a498bc9 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,8 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Series.dt.round\ pandas.Series.dt.floor\ pandas.Series.dt.ceil\ - pandas.Series.dt.month_name\ - pandas.Series.dt.day_name\ pandas.Series.cat.rename_categories\ pandas.Series.cat.reorder_categories\ pandas.Series.cat.add_categories\