| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.DataFrame.prod.html | [Back] [Original] |
Section Navigation
Return the product of the values over the requested axis.
Examples:
>>> import bigframes.pandas as bpd
>>> df = bpd.DataFrame({"A": [1, 2, 3], "B": [4.5, 5.5, 6.5]})
>>> df
A B
0 1 4.5
1 2 5.5
2 3 6.5
[3 rows x 2 columns]
Calculating the product of each column(the default behavior without an explicit axis parameter):
>>> df.prod()
A 6.0
B 160.875
dtype: Float64
Calculating the product of each row:
>>> df.prod(axis=1)
0 4.5
1 11.0
2 19.5
dtype: Float64
axis ({index (0), columns (1)}) Axis for the function to be applied on. For Series this parameter is unused and defaults to 0.
numeric_only (bool. default False) Include only float, int, boolean columns.
Series with the product of the values.
Copyright 2019, Google.
Created using Sphinx 8.1.3.
Built with the PyData Sphinx Theme 0.19.0.
| Web Proxy Viewer | New URL | Original Page |