@@ -164,32 +164,6 @@ class providing the base-class of operations.
164
164
to each row or column of a DataFrame.
165
165
"""
166
166
167
- _groupby_agg_method_template = """
168
- Compute {fname} of group values.
169
-
170
- Parameters
171
- ----------
172
- numeric_only : bool, default {no}
173
- Include only float, int, boolean columns.
174
-
175
- .. versionchanged:: 2.0.0
176
-
177
- numeric_only no longer accepts ``None``.
178
-
179
- min_count : int, default {mc}
180
- The required number of valid values to perform the operation. If fewer
181
- than ``min_count`` non-NA values are present the result will be NA.
182
-
183
- Returns
184
- -------
185
- Series or DataFrame
186
- Computed {fname} of values within each group.
187
-
188
- Examples
189
- --------
190
- {example}
191
- """
192
-
193
167
_groupby_agg_method_engine_template = """
194
168
Compute {fname} of group values.
195
169
@@ -3029,13 +3003,30 @@ def sum(
3029
3003
return result
3030
3004
3031
3005
@final
3032
- @doc (
3033
- _groupby_agg_method_template ,
3034
- fname = "prod" ,
3035
- no = False ,
3036
- mc = 0 ,
3037
- example = dedent (
3038
- """\
3006
+ def prod (self , numeric_only : bool = False , min_count : int = 0 ) -> NDFrameT :
3007
+ """
3008
+ Compute prod of group values.
3009
+
3010
+ Parameters
3011
+ ----------
3012
+ numeric_only : bool, default False
3013
+ Include only float, int, boolean columns.
3014
+
3015
+ .. versionchanged:: 2.0.0
3016
+
3017
+ numeric_only no longer accepts ``None``.
3018
+
3019
+ min_count : int, default 0
3020
+ The required number of valid values to perform the operation. If fewer
3021
+ than ``min_count`` non-NA values are present the result will be NA.
3022
+
3023
+ Returns
3024
+ -------
3025
+ Series or DataFrame
3026
+ Computed prod of values within each group.
3027
+
3028
+ Examples
3029
+ --------
3039
3030
For SeriesGroupBy:
3040
3031
3041
3032
>>> lst = ['a', 'a', 'b', 'b']
@@ -3066,10 +3057,12 @@ def sum(
3066
3057
b c
3067
3058
a
3068
3059
1 16 10
3069
- 2 30 72"""
3070
- ),
3071
- )
3072
- def prod (self , numeric_only : bool = False , min_count : int = 0 ) -> NDFrameT :
3060
+ 2 30 72
3061
+
3062
+ See Also
3063
+ --------
3064
+ DataFrame.prod : Return the product of the values over the requested axis.
3065
+ """
3073
3066
return self ._agg_general (
3074
3067
numeric_only = numeric_only , min_count = min_count , alias = "prod" , npfunc = np .prod
3075
3068
)
0 commit comments