Series.pow

Return Exponential power of series and other, element-wise (binary operator pow).

danfo.Series.pow(other) [source]

Parameters

Type

Description

Default

other

Series|int|

values

Return: Series

Example

Exponential power with values of another series

Node
Node
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()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 2 ║
╟───┼──────────────────────╢
║ 1 │ 9 ║
╟───┼──────────────────────╢
║ 2 │ 64 ║
╟───┼──────────────────────╢
║ 3 │ 1 ║
╚═══╧══════════════════════╝

Exponential value with a value

Node
Node
const dfd = require("danfojs-node")
let data1 = [1, 2, 3, 4, 5]
let sf1 = new dfd.Series(data1)
sf1.pow(2).print()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 1 ║
╟───┼──────────────────────╢
║ 1 │ 4 ║
╟───┼──────────────────────╢
║ 2 │ 9 ║
╟───┼──────────────────────╢
║ 3 │ 16 ║
╟───┼──────────────────────╢
║ 4 │ 25 ║
╚═══╧══════════════════════╝