pandas.Index.prod#

Index.prod(
*,
axis=None,
dtype=None,
out=<no_default>,
initial=None,
keepdims=False,
skipna=True,
min_count=0,
)[source]#

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_count non-NA values are present the result will be NA.

Returns:
scalar

The product of the values.

See also

Index.sum

Return the sum of the values.

Series.prod

Return the product of the values of a Series.

Examples

>>> pd.Index([1, 2, 3, 4]).prod()
24