Powered By GitBook
Series.abs
Returns the absolute value in a Series
danfo.Series.abs(options) [source]
Parameters
Type
Description
Default
options
Object
inplace: Boolean indicating whether to perform the operation in-place or not. Defaults to false
{
inplace: false
}
Returns: Series
Example
Node
1
const dfd = require("danfojs-node")
2
3
let data1 = [-10, 45, 56, -25, 23, -20, 10]
4
let sf = new dfd.Series(data1)
5
6
sf.abs().print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 10 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 45 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 56 ║
9
╟───┼──────────────────────╢
10
║ 3 │ 25 ║
11
╟───┼──────────────────────╢
12
║ 4 │ 23 ║
13
╟───┼──────────────────────╢
14
║ 5 │ 20 ║
15
╟───┼──────────────────────╢
16
║ 6 │ 10 ║
17
╚═══╧══════════════════════╝
Copied!
Last modified 24d ago
Copy link