DataFrame.cumMin
Return cumulative minimum over a DataFrame or Series axis.
danfo.DataFrame.cumMin(options)
Parameters | Type | Description | Default |
---|---|---|---|
options | Object | axis: 0 for row and 1 for column inplace: Boolean indicating whether to perform the operation inplace or not. Defaults to false | {axis: 1, inplace: false} |
Examples
Cumulative minimum of elements along axis 0 (row)
const dfd = require("danfojs-node")
let data = [[11, 20, 3], [1, 15, 6], [2, 30, 40], [2, 89, 78]]
let cols = ["A", "B", "C"]
let df = new dfd.DataFrame(data, { columns: cols })
let new_df = df.cumMin({ axis: 0 })
new_df.print()
βββββ€ββββββββββββββββββββ€ββββββββββββββββββββ€ββββββββββββββββββββ
β β A β B β C β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 0 β 11 β 20 β 3 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 1 β 1 β 15 β 3 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 2 β 1 β 15 β 3 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 3 β 1 β 15 β 3 β
βββββ§ββββββββββββββββββββ§ββββββββββββββββββββ§ββββββββββββββββββββ
Cumulative minimum of elements along column axis (1)
const dfd = require("danfojs-node")
let data = [[11, 20, 3], [1, 15, 6], [2, 30, 40], [2, 89, 78]]
let cols = ["A", "B", "C"]
let df = new dfd.DataFrame(data, { columns: cols })
let new_df = df.cumMin({ axis: 1 })
new_df.print()
βββββ€ββββββββββββββββββββ€ββββββββββββββββββββ€ββββββββββββββββββββ
β β A β B β C β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 0 β 11 β 11 β 3 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 1 β 1 β 1 β 1 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 2 β 2 β 2 β 2 β
βββββΌββββββββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββ’
β 3 β 2 β 2 β 2 β
βββββ§ββββββββββββββββββββ§ββββββββββββββββββββ§ββββββββββββββββββββ
Last updated