DataFrame.std
Return sample standard deviation over requested axis.
danfo.DataFrame.std(options)
Parameters
Type
Description
Default
options
Object
axis: 0 or 1. If 0, compute the mean column-wise, if 1, row-wise. Defaults to 1
{ axis: 1 }

Examples

Calculates the standard deviation of values along default axis 1 (column)

Node
Browser
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 })
df.std().print()
Output
╔═══╤════════════════════╗
║ 0 │ 8.504900548115383 ║
╟───┼────────────────────╢
║ 1 │ 7.094598884597588 ║
╟───┼────────────────────╢
║ 2 │ 19.697715603592208 ║
╟───┼────────────────────╢
║ 3 │ 47.37439533475159 ║
╚═══╧════════════════════╝

Calculates the standard deviation of values along row axis (0)

Node
Browser
const dfd = require("danfojs-node")
data = [[11, 20, 3], [1, 15, 6], [2, 30, 40], [2, 89, 78]]
cols = ["A", "B", "C"]
let df = new dfd.DataFrame(data)
df.std({axis:0}).print()
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ 8.504900548115383 ║
╟───┼──────────────────────╢
║ 1 │ 7.094598884597588 ║
╟───┼──────────────────────╢
║ 2 │ 19.697715603592208 ║
╟───┼──────────────────────╢
║ 3 │ 47.37439533475159 ║
╚═══╧══════════════════════╝

Copy link
On this page
Examples
Calculates the standard deviation of values along default axis 1 (column)
Calculates the standard deviation of values along row axis (0)