polars.Series.product#

Series.product() int | float[source]#

Reduce this Series to the product value.

Notes

If there are no non-null values, then the output is 1. If you would prefer empty products to return None, you can use s.product() if s.count() else None instead of s.product().

Examples

>>> s = pl.Series("a", [1, 2, 3])
>>> s.product()
6