pby.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ DataFrame ](../frame.html)
  * pandas.DataF... 

#  pandas.DataFrame.prod  #

DataFrame.  prod  (  _ axis  =  0  _ , _ skipna  =  True  _ , _ numeric_only
=  False  _ , _ min_count  =  0  _ , _ **  kwargs  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/frame.py#L11673-L11683) #

    

Return the product of the values over the requested axis.

Parameters  :

    

**axis** {index (0), columns (1)}

    

Axis for the function to be applied on. For  Series  this parameter is unused
and defaults to 0.

Warning

The behavior of DataFrame.prod with ` axis=None  ` is deprecated, in a future
version this will reduce over both axes and return a scalar To retain the old
behavior, pass axis=0 (or do not pass axis).

New in version 2.0.0.

**skipna** bool, default True

    

Exclude NA/null values when computing the result.

**numeric_only** bool, default False

    

Include only float, int, boolean columns. Not implemented for Series.

**min_count** int, default 0

    

The required number of valid values to perform the operation. If fewer than `
min_count  ` non-NA values are present the result will be NA.

****kwargs**

    

Additional keyword arguments to be passed to the function.

Returns  :

    

Series or scalar

    

See also

[ ` Series.sum  ` ](pandas.Series.sum.html#pandas.Series.sum
"pandas.Series.sum")

    

Return the sum.

[ ` Series.min  ` ](pandas.Series.min.html#pandas.Series.min
"pandas.Series.min")

    

Return the minimum.

[ ` Series.max  ` ](pandas.Series.max.html#pandas.Series.max
"pandas.Series.max")

    

Return the maximum.

[ ` Series.idxmin  ` ](pandas.Series.idxmin.html#pandas.Series.idxmin
"pandas.Series.idxmin")

    

Return the index of the minimum.

[ ` Series.idxmax  ` ](pandas.Series.idxmax.html#pandas.Series.idxmax
"pandas.Series.idxmax")

    

Return the index of the maximum.

[ ` DataFrame.sum  ` ](pandas.DataFrame.sum.html#pandas.DataFrame.sum
"pandas.DataFrame.sum")

    

Return the sum over the requested axis.

[ ` DataFrame.min  ` ](pandas.DataFrame.min.html#pandas.DataFrame.min
"pandas.DataFrame.min")

    

Return the minimum over the requested axis.

[ ` DataFrame.max  ` ](pandas.DataFrame.max.html#pandas.DataFrame.max
"pandas.DataFrame.max")

    

Return the maximum over the requested axis.

[ ` DataFrame.idxmin  ` ](pandas.DataFrame.idxmin.html#pandas.DataFrame.idxmin
"pandas.DataFrame.idxmin")

    

Return the index of the minimum over the requested axis.

[ ` DataFrame.idxmax  ` ](pandas.DataFrame.idxmax.html#pandas.DataFrame.idxmax
"pandas.DataFrame.idxmax")

    

Return the index of the maximum over the requested axis.

Examples

By default, the product of an empty or all-NA Series is ` 1  `

    
    
    >>> pd.Series([], dtype="float64").prod()
    1.0
    

This can be controlled with the ` min_count  ` parameter

    
    
    >>> pd.Series([], dtype="float64").prod(min_count=1)
    nan
    

Thanks to the ` skipna  ` parameter, ` min_count  ` handles all-NA and empty
series identically.

    
    
    >>> pd.Series([np.nan]).prod()
    1.0
    
    
    
    >>> pd.Series([np.nan]).prod(min_count=1)
    nan
    

[ __ previous  pandas.DataFrame.pct_change  ](pandas.DataFrame.pct_change.html
"previous page") [ next  pandas.DataFrame.product  __
](pandas.DataFrame.product.html "next page")

__ On this page

  * ` DataFrame.prod()  `

[ __ Show Source ](../../_sources/reference/api/pandas.DataFrame.prod.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built