Series.round

round off floating values in series

danfo.Series.round(dp) [source]

Parameters

Type

Description

Default

dp

int

decimal place to round off to

Returns: Series

Example

Node
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()
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 30.21 ║
╟───┼──────────────────────╢
║ 1 │ 40.19 ║
╟───┼──────────────────────╢
║ 2 │ 3.56 ║
╟───┼──────────────────────╢
║ 3 │ 5.02 ║
╚═══╧══════════════════════╝