From 90541381504753f409893e34142c4ad70ded0254 Mon Sep 17 00:00:00 2001 From: Dea Leon Date: Fri, 10 Feb 2023 11:20:07 +0100 Subject: [PATCH 1/2] DOC Fix EX01 errors - added example --- ci/code_checks.sh | 1 - pandas/core/base.py | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 3ad8a685c8ed3..fb1c497fc6afb 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -87,7 +87,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01 --ignore_functions \ pandas.Series.index \ pandas.Series.dtype \ - pandas.Series.shape \ pandas.Series.nbytes \ pandas.Series.ndim \ pandas.Series.size \ diff --git a/pandas/core/base.py b/pandas/core/base.py index b708ff44b39d0..db98b9e56359e 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -309,6 +309,15 @@ def transpose(self: _T, *args, **kwargs) -> _T: def shape(self) -> Shape: """ Return a tuple of the shape of the underlying data. + + Examples + -------- + >>> s = pd.Series([1, 2, 3]) + >>> s.shape + (3,) + + >>> pd.Series([1, 2, 3]).shape + (3,) """ return self._values.shape From 994915f2e2a27e563444fd170b30125edf3c00d7 Mon Sep 17 00:00:00 2001 From: Dea Leon Date: Fri, 10 Feb 2023 17:05:07 +0100 Subject: [PATCH 2/2] DOC Fix EX01 issue --- pandas/core/base.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index db98b9e56359e..8a1a2b8b99aa5 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -315,9 +315,6 @@ def shape(self) -> Shape: >>> s = pd.Series([1, 2, 3]) >>> s.shape (3,) - - >>> pd.Series([1, 2, 3]).shape - (3,) """ return self._values.shape