[ Web Proxy ]
URL:
Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.DataFrame.sum.html [Back]  [Original]

bigframes.pandas.DataFrame.sum — bigframes documentation
Back to top
Search the docs ...:

bigframes.pandas.DataFrame.sum#

DataFrame.sum(axis: str | int = 0, *, numeric_only: bool = False) Series[source]#

Return the sum of the values over the requested axis.

This is equivalent to the method numpy.sum.

Examples:

>>> df = bpd.DataFrame({"A": [1, 3], "B": [2, 4]})
>>> df
    A       B
0   1       2
1   3       4

[2 rows x 2 columns]

Calculating the sum of each column (the default behavior without an explicit axis parameter).

>>> df.sum()
A    4
B    6
dtype: Int64

Calculating the sum of each row.

>>> df.sum(axis=1)
0    3
1    7
dtype: Int64
Parameters:
  • 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) Default False. Include only float, int, boolean columns.

Returns:

Series with the sum of values.

Return type:

bigframes.pandas.Series


Web Proxy Viewer  |  New URL  |  Original Page