bigframes.pandas.DataFrame.pow#

DataFrame.pow(other: int | Series, axis: str | int = 'columns') DataFrame[source]#

Get Exponential power of dataframe and other, element-wise (binary operator **).

Equivalent to dataframe ** other, but with support to substitute a fill_value for missing data in one of the inputs. With reverse version, rpow.

Among flexible wrappers (add, sub, mul, div, mod, pow) to arithmetic operators: +, -, *, /, //, %, **.

Note

Mismatched indices will be unioned together.

Examples:

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

You can use method name:

>>> df['A'].pow(df['B'])
0      1
1     32
2    729
dtype: Int64

You can also use arithmetic operator **:

>>> df['A'] ** (df['B'])
0      1
1     32
2    729
dtype: Int64
Parameters:
  • other (float, int, or Series) – Any single or multiple element data structure, or list-like object.

  • axis ({0 or 'index', 1 or 'columns'}) – Whether to compare by the index (0 or ‘index’) or columns. (1 or ‘columns’). For Series input, axis to match Series index on.

Returns:

DataFrame result of the arithmetic operation.

Return type:

bigframes.pandas.DataFrame