Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.26 KB

series.abs.md

File metadata and controls

50 lines (41 loc) · 1.26 KB
description
Returns the absolute value in a Series

Series.abs

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

{% tabs %} {% tab title="Node" %}

const dfd = require("danfojs-node")

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

sf.abs().print()

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

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

{% endtab %} {% endtabs %}