DataFrame.std
Return sample standard deviation over requested axis.
danfo.DataFrame.std(options) [source]
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 }
Returns:
return Series

Examples

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

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().print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ 4.69041575982343 ║
5
╟───┼──────────────────────╢
6
║ 1 │ 34.23935357645254 ║
7
╟───┼──────────────────────╢
8
║ 2 │ 35.103418636936205 ║
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!

Last modified 17d ago