Skip to content

Latest commit

Β 

History

History
45 lines (36 loc) Β· 1.33 KB

File metadata and controls

45 lines (36 loc) Β· 1.33 KB
description round off floating values in series

Series.round

danfo.Series.round(dp, options)

Parameters Type Description Default
dp int decimal place to round off to
options Object inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false

{

inplace: false

}

Returns: Series

Example

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

const dfd = require("danfojs-node")

let data1 = [30.21091, 40.190901, 3.564, 5.0212]
let sf1 = new dfd.Series(data1)

sf1.round(2).print()

{% endtab %} {% endtabs %}

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

╔═══╀═══════╗
β•‘ 0 β”‚ 30.21 β•‘
β•Ÿβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 1 β”‚ 40.19 β•‘
β•Ÿβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 2 β”‚ 3.56  β•‘
β•Ÿβ”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 3 β”‚ 5.02  β•‘
β•šβ•β•β•β•§β•β•β•β•β•β•β•β•

{% endtab %} {% endtabs %}