Series.abs

Returns the absolute value in a Series

danfo.Series.abs(options)

ParametersTypeDescriptionDefault

options

Object

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

{

inplace: false

}

Returns: Series

Example

const dfd = require("danfojs-node")

let data1 = [-10, 45, 56, -25, 23, -20, 10]
let sf = new dfd.Series(data1)

sf.abs().print()
╔═══╤════╗
║ 0 │ 10 ║
╟───┼────╢
║ 1 │ 45 ║
╟───┼────╢
║ 2 │ 56 ║
╟───┼────╢
║ 3 │ 25 ║
╟───┼────╢
║ 4 │ 23 ║
╟───┼────╢
║ 5 │ 20 ║
╟───┼────╢
║ 6 │ 10 ║
╚═══╧════╝

Last updated