Skip to content

Commit 9867a78

Browse files
authored
docs: update GroupBy docstrings (#1103)
1 parent 108f4a9 commit 9867a78

File tree

1 file changed

+56
-30
lines changed
  • third_party/bigframes_vendored/pandas/core/groupby

1 file changed

+56
-30
lines changed

third_party/bigframes_vendored/pandas/core/groupby/__init__.py

+56-30
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def any(self):
4949
[2 rows x 2 columns]
5050
5151
Returns:
52-
Series or DataFrame: DataFrame or Series of boolean values,
52+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
53+
DataFrame or Series of boolean values,
5354
where a value is True if any element is True within its
5455
respective group; otherwise False.
5556
"""
@@ -87,7 +88,8 @@ def all(self):
8788
[2 rows x 2 columns]
8889
8990
Returns:
90-
Series or DataFrame: DataFrame or Series of boolean values,
91+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
92+
DataFrame or Series of boolean values,
9193
where a value is True if all elements are True within its
9294
respective group; otherwise False.
9395
"""
@@ -126,7 +128,8 @@ def count(self):
126128
[2 rows x 2 columns]
127129
128130
Returns:
129-
Series or DataFrame: Count of values within each group.
131+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
132+
Count of values within each group.
130133
"""
131134
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
132135

@@ -181,7 +184,8 @@ def mean(
181184
Include only float, int, boolean columns.
182185
183186
Returns:
184-
pandas.Series or pandas.DataFrame: Mean of groups.
187+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
188+
Mean of groups.
185189
"""
186190
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
187191

@@ -228,7 +232,8 @@ def median(
228232
Calculate the exact median instead of an approximation.
229233
230234
Returns:
231-
pandas.Series or pandas.DataFrame: Median of groups.
235+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
236+
Median of groups.
232237
"""
233238
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
234239

@@ -259,7 +264,8 @@ def quantile(self, q=0.5, *, numeric_only: bool = False):
259264
Include only `float`, `int` or `boolean` data.
260265
261266
Returns:
262-
Series or DataFrame: Return type determined by caller of GroupBy object.
267+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
268+
Return type determined by caller of GroupBy object.
263269
"""
264270
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
265271

@@ -305,7 +311,8 @@ def std(
305311
Include only `float`, `int` or `boolean` data.
306312
307313
Returns:
308-
Series or DataFrame: Standard deviation of values within each group.
314+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
315+
Standard deviation of values within each group.
309316
"""
310317
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
311318

@@ -351,7 +358,7 @@ def var(
351358
Include only `float`, `int` or `boolean` data.
352359
353360
Returns:
354-
Series or DataFrame
361+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
355362
Variance of values within each group.
356363
"""
357364
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
@@ -388,7 +395,7 @@ def skew(
388395
Include only `float`, `int` or `boolean` data.
389396
390397
Returns:
391-
Series or DataFrame
398+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
392399
Variance of values within each group.
393400
"""
394401
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
@@ -421,7 +428,7 @@ def kurt(
421428
Include only `float`, `int` or `boolean` data.
422429
423430
Returns:
424-
Series or DataFrame
431+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
425432
Variance of values within each group.
426433
"""
427434
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
@@ -454,7 +461,7 @@ def kurtosis(
454461
Include only `float`, `int` or `boolean` data.
455462
456463
Returns:
457-
Series or DataFrame
464+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
458465
Variance of values within each group.
459466
"""
460467
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
@@ -502,7 +509,8 @@ def sum(
502509
than ``min_count`` and non-NA values are present, the result will be NA.
503510
504511
Returns:
505-
Series or DataFrame: Computed sum of values within each group.
512+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
513+
Computed sum of values within each group.
506514
"""
507515
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
508516

@@ -534,7 +542,8 @@ def prod(self, numeric_only: bool = False, min_count: int = 0):
534542
than ``min_count`` and non-NA values are present, the result will be NA.
535543
536544
Returns:
537-
Series or DataFrame: Computed prod of values within each group.
545+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
546+
Computed prod of values within each group.
538547
"""
539548
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
540549

@@ -582,7 +591,8 @@ def min(
582591
than ``min_count`` and non-NA values are present, the result will be NA.
583592
584593
Returns:
585-
Series or DataFrame: Computed min of values within each group.
594+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
595+
Computed min of values within each group.
586596
"""
587597
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
588598

@@ -629,7 +639,8 @@ def max(
629639
than ``min_count`` and non-NA values are present, the result will be NA.
630640
631641
Returns:
632-
Series or DataFrame: Computed max of values within each group.
642+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
643+
Computed max of values within each group.
633644
"""
634645
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
635646

@@ -667,7 +678,8 @@ def cumcount(self, ascending: bool = True):
667678
If False, number in reverse, from length of group - 1 to 0.
668679
669680
Returns:
670-
Series: Sequence number of each element within each group.
681+
bigframes.pandas.Series:
682+
Sequence number of each element within each group.
671683
"""
672684
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
673685

@@ -705,7 +717,8 @@ def cumprod(self, *args, **kwargs):
705717
[3 rows x 2 columns]
706718
707719
Returns:
708-
Series or DataFrame: Cumulative product for each group.
720+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
721+
Cumulative product for each group.
709722
"""
710723
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
711724

@@ -743,7 +756,8 @@ def cumsum(self, *args, **kwargs):
743756
[3 rows x 2 columns]
744757
745758
Returns:
746-
Series or DataFrame: Cumulative sum for each group.
759+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
760+
Cumulative sum for each group.
747761
"""
748762
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
749763

@@ -781,7 +795,8 @@ def cummin(self, *args, numeric_only: bool = False, **kwargs):
781795
[3 rows x 2 columns]
782796
783797
Returns:
784-
Series or DataFrame: Cumulative min for each group.
798+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
799+
Cumulative min for each group.
785800
"""
786801
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
787802

@@ -819,7 +834,8 @@ def cummax(self, *args, numeric_only: bool = False, **kwargs):
819834
[3 rows x 2 columns]
820835
821836
Returns:
822-
Series or DataFrame: Cumulative max for each group.
837+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
838+
Cumulative max for each group.
823839
"""
824840
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
825841

@@ -866,7 +882,8 @@ def diff(self):
866882
[7 rows x 2 columns]
867883
868884
Returns:
869-
Series or DataFrame: First differences.
885+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
886+
First differences.
870887
"""
871888
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
872889

@@ -910,7 +927,8 @@ def shift(self, periods: int = 1):
910927
Number of periods to shift.
911928
912929
Returns:
913-
Series or DataFrame: Object shifted within each group.
930+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
931+
Object shifted within each group.
914932
"""
915933
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
916934

@@ -947,7 +965,8 @@ def rolling(self, *args, **kwargs):
947965
to the size of the window.
948966
949967
Returns:
950-
Series or DataFrame: Return a new grouper with our rolling appended.
968+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
969+
Return a new grouper with our rolling appended.
951970
"""
952971
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
953972

@@ -973,7 +992,8 @@ def expanding(self, *args, **kwargs):
973992
dtype: Int64
974993
975994
Returns:
976-
Series or DataFrame: An expanding grouper, providing expanding functionality per group.
995+
bigframes.pandas.DataFrame or bigframes.pandas.Series:
996+
An expanding grouper, providing expanding functionality per group.
977997
"""
978998
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
979999

@@ -1007,7 +1027,8 @@ def agg(self, func):
10071027
- list of function names, e.g. ``['sum', 'mean']``
10081028
10091029
Returns:
1010-
Series or DataFrame
1030+
bigframes.pandas.Series:
1031+
A BigQuery Series.
10111032
"""
10121033
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
10131034

@@ -1039,7 +1060,8 @@ def aggregate(self, func):
10391060
- list of function names, e.g. ``['sum', 'mean']``
10401061
10411062
Returns:
1042-
Series or DataFrame
1063+
bigframes.pandas.Series:
1064+
A BigQuery Series.
10431065
"""
10441066
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
10451067

@@ -1061,7 +1083,8 @@ def nunique(self):
10611083
dtype: Int64
10621084
10631085
Returns:
1064-
Series: Number of unique values within each group.
1086+
bigframes.pandas.Series:
1087+
Number of unique values within each group.
10651088
"""
10661089
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
10671090

@@ -1122,7 +1145,8 @@ def agg(self, func, **kwargs):
11221145
aggregations via Named Aggregation. See ``func`` entry.
11231146
11241147
Returns:
1125-
DataFrame
1148+
bigframes.pandas.DataFrame:
1149+
A BigQuery DataFrame.
11261150
"""
11271151
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
11281152

@@ -1181,7 +1205,8 @@ def aggregate(self, func, **kwargs):
11811205
aggregations via Named Aggregation. See ``func`` entry.
11821206
11831207
Returns:
1184-
DataFrame
1208+
bigframes.pandas.DataFrame:
1209+
A BigQuery DataFrame.
11851210
"""
11861211
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
11871212

@@ -1209,6 +1234,7 @@ def nunique(self):
12091234
[3 rows x 2 columns]
12101235
12111236
Returns:
1212-
DataFrame
1237+
bigframes.pandas.DataFrame:
1238+
Number of unique values within a BigQuery DataFrame.
12131239
"""
12141240
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

0 commit comments

Comments
 (0)