From a87eb22b9f667f3ebf47bed3bbab614084b8c394 Mon Sep 17 00:00:00 2001 From: gvmmybear <46094200+gvmmybear@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:56:43 -0600 Subject: [PATCH 1/4] fix indices docstring error SA01 --- ci/code_checks.sh | 3 --- pandas/core/groupby/groupby.py | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 9faa2a249613b..96e06ab0d6234 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -89,16 +89,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.arrays.TimedeltaArray PR07,SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \ - -i "pandas.core.groupby.DataFrameGroupBy.indices SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.nunique SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \ -i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \ -i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \ - -i "pandas.core.groupby.SeriesGroupBy.indices SA01" \ -i "pandas.core.groupby.SeriesGroupBy.plot PR02" \ -i "pandas.core.groupby.SeriesGroupBy.sem SA01" \ -i "pandas.core.resample.Resampler.get_group RT03,SA01" \ - -i "pandas.core.resample.Resampler.indices SA01" \ -i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \ -i "pandas.core.resample.Resampler.mean SA01" \ -i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \ diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index ad23127ad449f..eb52be7ab742d 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -515,6 +515,15 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: """ Dict {group name -> group indices}. + See Also + -------- + core.groupby.DataFrameGroupBy.indices : Provides a mapping of group names to + positions of the elements in object. + core.resample.Resampler.indices : Provides a mapping of group names to + positions of the elements in object. + core.resample.Resampler.indices : Provides a mapping of group names to + positions of the elements in object. + Examples -------- From bf2fd65327374549300719e06e98172ca80f1ee1 Mon Sep 17 00:00:00 2001 From: gvmmybear <46094200+gvmmybear@users.noreply.github.com> Date: Thu, 28 Nov 2024 15:08:59 -0600 Subject: [PATCH 2/4] correcting See Also entry for indices --- pandas/core/groupby/groupby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index eb52be7ab742d..806bbc68252a1 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -519,7 +519,7 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: -------- core.groupby.DataFrameGroupBy.indices : Provides a mapping of group names to positions of the elements in object. - core.resample.Resampler.indices : Provides a mapping of group names to + core.groupby.SeriesGroupBy.indices : Provides a mapping of group names to positions of the elements in object. core.resample.Resampler.indices : Provides a mapping of group names to positions of the elements in object. From c327878d3297d961bdf528a873c8ade57c31d5f0 Mon Sep 17 00:00:00 2001 From: gvmmybear <46094200+gvmmybear@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:17:02 -0600 Subject: [PATCH 3/4] correcting 'See Also' function descriptions and adding missing white spaces for indices docstring --- pandas/core/groupby/groupby.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 806bbc68252a1..85fb390ae3d6b 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -517,12 +517,12 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: See Also -------- - core.groupby.DataFrameGroupBy.indices : Provides a mapping of group names to - positions of the elements in object. - core.groupby.SeriesGroupBy.indices : Provides a mapping of group names to - positions of the elements in object. - core.resample.Resampler.indices : Provides a mapping of group names to - positions of the elements in object. + core.groupby.DataFrameGroupBy.indices : Provides a mapping of group rows to + positions of the elements in object. + core.groupby.SeriesGroupBy.indices : Provides a mapping of group rows to + positions of the elements in object. + core.resample.Resampler.indices : Provides a mapping of group rows to + positions of the elements in object. Examples -------- From 24ac88ceaeaa532958497ca3935d0c8f0656156f Mon Sep 17 00:00:00 2001 From: gvmmybear <46094200+gvmmybear@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:39:15 -0600 Subject: [PATCH 4/4] Removing unneeded verbiage in indices docstring 'See Also' section --- pandas/core/groupby/groupby.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 85fb390ae3d6b..48d4e0456d4fa 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -518,11 +518,11 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]: See Also -------- core.groupby.DataFrameGroupBy.indices : Provides a mapping of group rows to - positions of the elements in object. + positions of the elements. core.groupby.SeriesGroupBy.indices : Provides a mapping of group rows to - positions of the elements in object. + positions of the elements. core.resample.Resampler.indices : Provides a mapping of group rows to - positions of the elements in object. + positions of the elements. Examples --------