From eaca7902cb95762fbf5cf0b54d5dfc71dc9ee59c Mon Sep 17 00:00:00 2001 From: Konstantinos Papazafeiropoulos Date: Mon, 26 Aug 2024 15:41:28 +0100 Subject: [PATCH 1/5] adding extended summary, populating return description and adding see also section --- pandas/core/indexes/datetimelike.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandas/core/indexes/datetimelike.py b/pandas/core/indexes/datetimelike.py index e1120466eaf83..8b316de30662c 100644 --- a/pandas/core/indexes/datetimelike.py +++ b/pandas/core/indexes/datetimelike.py @@ -441,6 +441,10 @@ def as_unit(self, unit: str) -> Self: """ Convert to a dtype with the given unit resolution. + This method is for converting the dtype of a ``DatetimeIndex`` or + ``TimedeltaIndex`` to a new dtype with the given unit + resolution/precision. + Parameters ---------- unit : {'s', 'ms', 'us', 'ns'} @@ -448,6 +452,14 @@ def as_unit(self, unit: str) -> Self: Returns ------- same type as self + Converted to the specified unit. + + See Also + -------- + Timestamp.as_unit : Convert to the given unit. + Timedelta.as_unit : Convert to the given unit. + DatetimeIndex.as_unit : Convert to the given unit. + TimedeltaIndex.as_unit : Convert to the given unit. Examples -------- From f45d54e901ebe37c871837b157b53e67a25f3a51 Mon Sep 17 00:00:00 2001 From: Konstantinos Papazafeiropoulos Date: Mon, 26 Aug 2024 15:41:52 +0100 Subject: [PATCH 2/5] populating return description section --- pandas/core/indexes/multi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index c3d4ad721c830..239b3f9d9afa1 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1894,6 +1894,7 @@ def to_frame( Returns ------- DataFrame + DataFrame representation of the MultiIndex, with levels as columns. See Also -------- From 57092ff76932dee2638a4d0e9055d9dab47e136f Mon Sep 17 00:00:00 2001 From: Konstantinos Papazafeiropoulos Date: Mon, 26 Aug 2024 15:42:02 +0100 Subject: [PATCH 3/5] populating return description section --- pandas/core/strings/accessor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index 1014c9559afaf..118f0ec68c69f 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -1828,6 +1828,8 @@ def zfill(self, width: int): Returns ------- Series/Index of objects. + A Series or Index where the strings are modified by prepending + '0' characters. See Also -------- From 4d1f0afd80683906e728e33135d5605f17a25e42 Mon Sep 17 00:00:00 2001 From: Konstantinos Papazafeiropoulos Date: Tue, 27 Aug 2024 08:56:43 +0100 Subject: [PATCH 4/5] fixing zfil docstrign as per PR #59597 --- pandas/core/strings/accessor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index 118f0ec68c69f..aa20b5d8eb14f 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -1828,8 +1828,7 @@ def zfill(self, width: int): Returns ------- Series/Index of objects. - A Series or Index where the strings are modified by prepending - '0' characters. + A Series or Index where the strings are prepended with '0' characters. See Also -------- From 4172738a93b0dc2315435ff183f94e180c4c1ae9 Mon Sep 17 00:00:00 2001 From: Konstantinos Papazafeiropoulos Date: Tue, 27 Aug 2024 08:59:35 +0100 Subject: [PATCH 5/5] removing methods whose docstrign has been fixed from code_checks.sh script --- ci/code_checks.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index ac163a3408c25..e04e98ef6f568 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i ES01 `# For now it is ok if docstrings are missing the extended summary` \ -i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \ -i "pandas.MultiIndex.reorder_levels RT03,SA01" \ - -i "pandas.MultiIndex.to_frame RT03" \ -i "pandas.NA SA01" \ -i "pandas.NaT SA01" \ -i "pandas.Period.freq GL08" \ @@ -174,7 +173,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timedelta.to_timedelta64 SA01" \ -i "pandas.Timedelta.total_seconds SA01" \ -i "pandas.Timedelta.view SA01" \ - -i "pandas.TimedeltaIndex.as_unit RT03,SA01" \ -i "pandas.TimedeltaIndex.components SA01" \ -i "pandas.TimedeltaIndex.microseconds SA01" \ -i "pandas.TimedeltaIndex.nanoseconds SA01" \