Series.abs
Returns the absolute value in a Series
danfo.Series.abs(options)
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
const dfd = require("danfojs-node")
let data1 = [-10, 45, 56, -25, 23, -20, 10]
let sf = new dfd.Series(data1)
sf.abs().print()
Output
╔═══╤════╗
║ 0 │ 10 ║
╟───┼────╢
║ 1 │ 45 ║
╟───┼────╢
║ 2 │ 56 ║
╟───┼────╢
║ 3 │ 25 ║
╟───┼────╢
║ 4 │ 23 ║
╟───┼────╢
║ 5 │ 20 ║
╟───┼────╢
║ 6 │ 10 ║
╚═══╧════╝
Copy link