From 491967473a1fed1b0c05dd48ce751059d5456ab8 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Mon, 14 Oct 2024 13:34:23 +0530 Subject: [PATCH 1/4] DOC: fix RT03,SA01,ES01 for pandas.core.resample.Resampler.__iter__ --- ci/code_checks.sh | 1 - pandas/core/groupby/groupby.py | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 1974c98a1d1ff..e1e300c55dec2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -117,7 +117,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.core.groupby.SeriesGroupBy.ohlc SA01" \ -i "pandas.core.groupby.SeriesGroupBy.plot PR02" \ -i "pandas.core.groupby.SeriesGroupBy.sem SA01" \ - -i "pandas.core.resample.Resampler.__iter__ RT03,SA01" \ -i "pandas.core.resample.Resampler.get_group RT03,SA01" \ -i "pandas.core.resample.Resampler.groups SA01" \ -i "pandas.core.resample.Resampler.indices SA01" \ diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 8dfef9e70db52..5e4f7480953c9 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -767,10 +767,23 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]: """ Groupby iterator. + This method provides an iterator over the groups created by the resampling + operation on the object. The method yields tuples where the first element + is the label (group key) corresponding to each resampled bin, and the second + element is the subset of the data that falls within that bin. + Returns ------- - Generator yielding sequence of (name, subsetted object) - for each group + Iterator + Generator yielding a sequence of (name, subsetted object) + for each resampled group. + + See Also + -------- + Series.groupby : Group data by a specific key or column. + DataFrame.groupby : Group DataFrame using mapper or by columns. + DataFrame.resample : Resample a DataFrame. + Series.resample : Resample a Series. Examples -------- From 8b37394e3966230d1af9d0f993db815aa12820f7 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Thu, 17 Oct 2024 00:35:03 +0530 Subject: [PATCH 2/4] DOC: fix RT03,SA01,ES01 for __iter__ --- ci/code_checks.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index e1e300c55dec2..c487cdd6b61d4 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -97,7 +97,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.arrays.NumpyExtensionArray SA01" \ -i "pandas.arrays.SparseArray PR07,SA01" \ -i "pandas.arrays.TimedeltaArray PR07,SA01" \ - -i "pandas.core.groupby.DataFrameGroupBy.__iter__ RT03,SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.boxplot PR07,RT03,SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.get_group RT03,SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.groups SA01" \ @@ -107,7 +106,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.core.groupby.DataFrameGroupBy.ohlc SA01" \ -i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \ -i "pandas.core.groupby.DataFrameGroupBy.sem SA01" \ - -i "pandas.core.groupby.SeriesGroupBy.__iter__ RT03,SA01" \ -i "pandas.core.groupby.SeriesGroupBy.get_group RT03,SA01" \ -i "pandas.core.groupby.SeriesGroupBy.groups SA01" \ -i "pandas.core.groupby.SeriesGroupBy.indices SA01" \ From e2616dbe729c6cfcaf6f8b9c4e59937ac262a8d5 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Tue, 22 Oct 2024 09:17:01 +0530 Subject: [PATCH 3/4] DOC: fix SA01 for pandas.core.resample.Resampler.__iter__ --- pandas/core/groupby/groupby.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 5e4f7480953c9..16b51d2c83aa1 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -767,10 +767,11 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]: """ Groupby iterator. - This method provides an iterator over the groups created by the resampling - operation on the object. The method yields tuples where the first element - is the label (group key) corresponding to each resampled bin, and the second - element is the subset of the data that falls within that bin. + This method provides an iterator over the groups created by the ``resample`` + or ``groupby`` operation on the object. The method yields tuples where + the first element is the label (group key) corresponding to each resampled + bin, and the second element is the subset of the data that falls within that + bin. Returns ------- From d745960b9fe00c6cfaf41e974a426815db372c38 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Wed, 23 Oct 2024 10:11:46 +0530 Subject: [PATCH 4/4] DOC: fix SA01 for pandas.core.resample.Resampler.__iter__ --- pandas/core/groupby/groupby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 91831a7c03d71..a0bd25525c55f 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -769,15 +769,15 @@ def __iter__(self) -> Iterator[tuple[Hashable, NDFrameT]]: This method provides an iterator over the groups created by the ``resample`` or ``groupby`` operation on the object. The method yields tuples where - the first element is the label (group key) corresponding to each resampled - bin, and the second element is the subset of the data that falls within that - bin. + the first element is the label (group key) corresponding to each group or + resampled bin, and the second element is the subset of the data that falls + within that group or bin. Returns ------- Iterator Generator yielding a sequence of (name, subsetted object) - for each resampled group. + for each group. See Also --------