cudf.DataFrame.product#

DataFrame.product(axis=_NoDefault.no_default, skipna=True, dtype=None, numeric_only=False, min_count=0, **kwargs)[source]#

Return product of the values in the DataFrame.

Parameters:
axis: {index (0), columns(1)}

Axis for the function to be applied on.

skipna: bool, default True

Exclude NA/null values when computing the result.

dtype: data type

Data type to cast the result to.

numeric_onlybool, default False

If True, includes only float, int, boolean columns. If False, will raise error in-case there are non-numeric columns.

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.

The default being 0. This means the sum of an all-NA or empty Series is 0, and the product of an all-NA or empty Series is 1.

Returns:
Series

Examples

>>> import cudf
>>> df = cudf.DataFrame({'a': [1, 2, 3, 4], 'b': [7, 8, 9, 10]})
>>> df.product()
a      24
b    5040
dtype: int64