@@ -11730,7 +11730,6 @@ def sum(
11730
11730
return result
11731
11731
11732
11732
@deprecate_nonkeyword_arguments (version = "3.0" , allowed_args = ["self" ], name = "prod" )
11733
- @doc (make_doc ("prod" , ndim = 2 ))
11734
11733
def prod (
11735
11734
self ,
11736
11735
axis : Axis | None = 0 ,
@@ -11739,6 +11738,73 @@ def prod(
11739
11738
min_count : int = 0 ,
11740
11739
** kwargs ,
11741
11740
) -> Series :
11741
+ """
11742
+ Return the product of the values over the requested axis.
11743
+
11744
+ Parameters
11745
+ ----------
11746
+ axis : {index (0), columns (1)}
11747
+ Axis for the function to be applied on.
11748
+ For `Series` this parameter is unused and defaults to 0.
11749
+
11750
+ .. warning::
11751
+
11752
+ The behavior of DataFrame.prod with ``axis=None`` is deprecated,
11753
+ in a future version this will reduce over both axes and return a scalar
11754
+ To retain the old behavior, pass axis=0 (or do not pass axis).
11755
+
11756
+ .. versionadded:: 2.0.0
11757
+
11758
+ skipna : bool, default True
11759
+ Exclude NA/null values when computing the result.
11760
+ numeric_only : bool, default False
11761
+ Include only float, int, boolean columns. Not implemented for Series.
11762
+
11763
+ min_count : int, default 0
11764
+ The required number of valid values to perform the operation. If fewer than
11765
+ ``min_count`` non-NA values are present the result will be NA.
11766
+ **kwargs
11767
+ Additional keyword arguments to be passed to the function.
11768
+
11769
+ Returns
11770
+ -------
11771
+ Series or scalar
11772
+ The product of the values over the requested axis.
11773
+
11774
+ See Also
11775
+ --------
11776
+ Series.sum : Return the sum.
11777
+ Series.min : Return the minimum.
11778
+ Series.max : Return the maximum.
11779
+ Series.idxmin : Return the index of the minimum.
11780
+ Series.idxmax : Return the index of the maximum.
11781
+ DataFrame.sum : Return the sum over the requested axis.
11782
+ DataFrame.min : Return the minimum over the requested axis.
11783
+ DataFrame.max : Return the maximum over the requested axis.
11784
+ DataFrame.idxmin : Return the index of the minimum over the requested axis.
11785
+ DataFrame.idxmax : Return the index of the maximum over the requested axis.
11786
+
11787
+ Examples
11788
+ --------
11789
+ By default, the product of an empty or all-NA Series is ``1``
11790
+
11791
+ >>> pd.Series([], dtype="float64").prod()
11792
+ 1.0
11793
+
11794
+ This can be controlled with the ``min_count`` parameter
11795
+
11796
+ >>> pd.Series([], dtype="float64").prod(min_count=1)
11797
+ nan
11798
+
11799
+ Thanks to the ``skipna`` parameter, ``min_count`` handles all-NA and
11800
+ empty series identically.
11801
+
11802
+ >>> pd.Series([np.nan]).prod()
11803
+ 1.0
11804
+
11805
+ >>> pd.Series([np.nan]).prod(min_count=1)
11806
+ nan
11807
+ """
11742
11808
result = super ().prod (
11743
11809
axis = axis ,
11744
11810
skipna = skipna ,
0 commit comments