DataFrame.pow
Get Exponential power of dataframe and other, element-wise (binary operator pow).
danfo.DataFrame.pow(other, option)
Parameters
Type
Description
Default
other
DataFrame, Series, Array or Scalar
Object to raised to power with
option
Object
{
axis: 0 for row, 1 for column.
inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false
}
{ axis: 1, inplace: false }
Examples
Exponential of scalar with DataFrame along default axis 1
const dfd = require("danfojs-node")
let data = {
"Col1": [10, 45, 56, 10],
"Col2": [23, 20, 10, 24]
}
let df = new dfd.DataFrame(data)
let df_new = df.pow(2)
df_new.print()╔════════════╤═══════════════════╤═══════════════════╗
║ │ Col1 │ Col2 ║
╟────────────┼───────────────────┼───────────────────╢
║ 0 │ 100 │ 529 ║
╟────────────┼───────────────────┼───────────────────╢
║ 1 │ 2025 │ 400 ║
╟────────────┼───────────────────┼───────────────────╢
║ 2 │ 3136 │ 100 ║
╟────────────┼───────────────────┼───────────────────╢
║ 3 │ 100 │ 576 ║
╚════════════╧═══════════════════╧═══════════════════╝
Exponential of Series with DataFrame along axis 0
Exponential of DataFrame with another DataFrame
Exponential of Array with DataFrame along axis 0
Exponential works inplace
Last updated
Was this helpful?