Series.cumProd
Return the cumulative product of a series
danfo.Series.cumProd()
Parameters
Type
Description
Default
options
Object
inplace: Whether to perform the operation in-place or not.
{
inplace: false
}
Example
Node
1
const dfd = require("danfojs-node")
2
3
4
let data1 = [10, 45, 56, 25, 23, 20, 10]
5
let sf1 = new dfd.Series(data1)
6
7
sf1.cumProd().print()
Copied!
Output
1
╔═══╤════════════╗
2
║ 0 │ 10 ║
3
╟───┼────────────╢
4
║ 1 │ 450 ║
5
╟───┼────────────╢
6
║ 2 │ 25200 ║
7
╟───┼────────────╢
8
║ 3 │ 630000 ║
9
╟───┼────────────╢
10
║ 4 │ 14490000 ║
11
╟───┼────────────╢
12
║ 5 │ 289800000 ║
13
╟───┼────────────╢
14
║ 6 │ 2898000000 ║
15
╚═══╧════════════╝
Copied!
Last modified 13d ago
Copy link