datatable.sd()

Calculate the standard deviation for each column from cols.

Parameters

cols
Expr

Input columns.

return
Expr

f-expression having one row, and the same names and number of columns as in cols. The column stypes are float32 for float32 columns, and float64 for all the other numeric types.

except
TypeError

The exception is raised when one of the columns from cols has a non-numeric type.

Examples

from datatable import dt, f DT = dt.Frame(A = [0, 1, 2, 3], B = [0, 2, 4, 6]) DT
AB
int32int32
000
112
224
336

Get the standard deviation of column A:

DT[:, dt.sd(f.A)]
A
float64
01.29099

Get the standard deviation of columns A and B:

DT[:, dt.sd([f.A, f.B])]
AB
float64float64
01.290992.58199

See Also

  • mean() – function to calculate mean values.

  • median() – function to calculate median values.