Links

Series.round

round off floating values in series
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
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
╔═══╤═══════╗
║ 0 │ 30.21 ║
╟───┼───────╢
║ 1 │ 40.19 ║
╟───┼───────╢
║ 2 │ 3.56 ║
╟───┼───────╢
║ 3 │ 5.02 ║
╚═══╧═══════╝