Powered By GitBook
Series.pow
Return Exponential power of series and other, element-wise (binary operator pow).
danfo.Series.pow(other, options) [source]
Parameters
Type
Description
Default
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
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [2, 3, 4, 5]
4
let data2 = [1, 2, 3, 0]
5
let sf1 = new dfd.Series(data1)
6
let sf2 = new dfd.Series(data2)
7
sf1.pow(sf2).print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 2 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 9 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 64 ║
9
╟───┼──────────────────────╢
10
║ 3 │ 1 ║
11
╚═══╧══════════════════════╝
Copied!
Exponential value with a value
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [1, 2, 3, 4, 5]
4
let sf1 = new dfd.Series(data1)
5
6
sf1.pow(2).print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 1 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 4 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 9 ║
9
╟───┼──────────────────────╢
10
║ 3 │ 16 ║
11
╟───┼──────────────────────╢
12
║ 4 │ 25 ║
13
╚═══╧══════════════════════╝
Copied!
Last modified 13d ago
Copy link