pandas.Index.prod#
- Index.prod(
- *,
- axis=None,
- dtype=None,
- out=<no_default>,
- initial=None,
- keepdims=False,
- skipna=True,
- min_count=0,
Return the product of the values in the Index.
NA/null values are excluded by default.
- Parameters:
- axis{None, 0}
Unused. Parameter needed for compatibility with numpy.
- dtype, out, initialNone
Not implemented; kept for compatibility with
numpy.prod(), which calls this method. Must be left at the default.- keepdimsbool, default False
Not implemented; must be left at the default.
- skipnabool, default True
Exclude NA/null values when computing the result.
- min_countint, default 0
The required number of valid values to perform the operation. If fewer than
min_countnon-NA values are present the result will be NA.
- Returns:
- scalar
The product of the values.
See also
Index.sumReturn the sum of the values.
Series.prodReturn the product of the values of a Series.
Examples
>>> pd.Index([1, 2, 3, 4]).prod() 24