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
1
const dfd = require("danfojs-node")
2
let data = [[11, 20, 3], [1, 15, 6], [2, 30, 40], [2, 89, 78]]
3
let cols = ["A", "B", "C"]
4
5
let df = new dfd.DataFrame(data, { columns: cols })
6
df.std().print()
Copied!
1
Copied!
Output
1
╔═══╤════════════════════╗
2
║ 0 │ 8.504900548115383 ║
3
╟───┼────────────────────╢
4
║ 1 │ 7.094598884597588 ║
5
╟───┼────────────────────╢
6
║ 2 │ 19.697715603592208 ║
7
╟───┼────────────────────╢
8
║ 3 │ 47.37439533475159 ║
9
╚═══╧════════════════════╝
Copied!

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

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