Series.pow

Returns the exponential power of series and other, element-wise (binary operator pow).

danfo.Series.pow(other, options)

ParametersTypeDescriptionDefault

other

Series|int|

values

options

Object

inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false

{

inplace: false

}

Return: Series

Example

Exponential power with values of another series

const dfd = require("danfojs-node")

let data1 = [2, 3, 4, 5]
let data2 = [1, 2, 3, 0]
let sf1 = new dfd.Series(data1)
let sf2 = new dfd.Series(data2)
sf1.pow(sf2).print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ 2                    ║
╟───┼──────────────────────╢
║ 1 │ 9                    ║
╟───┼──────────────────────╢
║ 2 │ 64                   ║
╟───┼──────────────────────╢
║ 3 │ 1                    ║
╚═══╧══════════════════════╝

Exponential value with a value

const dfd = require("danfojs-node")

let data1 = [1, 2, 3, 4, 5]
let sf1 = new dfd.Series(data1)

sf1.pow(2).print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ 1                    ║
╟───┼──────────────────────╢
║ 1 │ 4                    ║
╟───┼──────────────────────╢
║ 2 │ 9                    ║
╟───┼──────────────────────╢
║ 3 │ 16                   ║
╟───┼──────────────────────╢
║ 4 │ 25                   ║
╚═══╧══════════════════════╝

Last updated