Powered By GitBook
Series.round
round off floating values in series
danfo.Series.round(dp, options) [source]
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
1
const dfd = require("danfojs-node")
2
3
let data1 = [30.21091, 40.190901, 3.564, 5.0212]
4
let sf1 = new dfd.Series(data1)
5
6
sf1.round(2).print()
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 30.21 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 40.19 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 3.56 ║
9
╟───┼──────────────────────╢
10
║ 3 │ 5.02 ║
11
╚═══╧══════════════════════╝
Copied!
Last modified 24d ago
Copy link