Skip to content

Latest commit

 

History

History
95 lines (77 loc) · 4.82 KB

danfo.dataframe.cummin.md

File metadata and controls

95 lines (77 loc) · 4.82 KB
description
Return cumulative minimum over a DataFrame or Series axis.

DataFrame.cumMin

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)

{% tabs %} {% tab title="Node" %}

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()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

╔═══╤═══════════════════╤═══════════════════╤═══════════════════╗
║   │ A                 │ B                 │ C                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 0 │ 11                │ 20                │ 3                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 1 │ 1                 │ 15                │ 3                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 2 │ 1                 │ 15                │ 3                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 3 │ 1                 │ 15                │ 3                 ║
╚═══╧═══════════════════╧═══════════════════╧═══════════════════╝

{% endtab %} {% endtabs %}

Cumulative minimum of elements along column axis (1)

{% tabs %} {% tab title="Node" %}

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()

{% endtab %}

{% tab title="Browser" %}

{% endtab %} {% endtabs %}

{% tabs %} {% tab title="Output" %}

╔═══╤═══════════════════╤═══════════════════╤═══════════════════╗
║   │ A                 │ B                 │ C                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 0 │ 11                │ 11                │ 3                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 1 │ 1                 │ 1                 │ 1                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 2 │ 2                 │ 2                 │ 2                 ║
╟───┼───────────────────┼───────────────────┼───────────────────╢
║ 3 │ 2                 │ 2                 │ 2                 ║
╚═══╧═══════════════════╧═══════════════════╧═══════════════════╝

{% endtab %} {% endtabs %}