DataFrame.describe

Generate descriptive statistics for each numeric column. Numeric columns are of type Int and float.

danfo.DataFrame.describe()

Examples

Descriptive statistics include those that summarize the central tendency, dispersion and shape of a dataset’s distribution, excluding NaN values.

const dfd = require("danfojs-node")

let data = [[0, 2, 4, "a"], [360, 180, 360, "b"], [2, 4, 6, "c"]]
let col_names = ["col1", "col2", "col3", "col4"]
let df = new dfd.DataFrame(data, {columns: col_names})

df.describe().print()
╔════════════╤═══════════════════╤═══════════════════╤═══════════════════╗
║            │ col1              │ col2              │ col3              ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ count      │ 3                 │ 3                 │ 3                 ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ mean       │ 120.66666666666…  │ 62                │ 123.33333333333…  ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ std        │ 207.27115895206…  │ 102.19589032832…  │ 204.961785055979  ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ min        │ 0                 │ 2                 │ 4                 ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ median     │ 2                 │ 4                 │ 6                 ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ max        │ 360               │ 180               │ 360               ║
╟────────────┼───────────────────┼───────────────────┼───────────────────╢
║ variance   │ 42961.333333333…  │ 10444             │ 42009.333333333…  ║
╚════════════╧═══════════════════╧═══════════════════╧═══════════════════╝

Last updated