datatable.rowsd()

For each row, find the standard deviation among the columns from cols skipping missing values. If a row contains only the missing values, this function will produce a missing value too.

Parameters

cols
FExpr

Input columns.

return
FExpr

f-expression consisting of one column that has the same number of rows as in cols. The column stype is float32 when all the cols are float32, and float64 in all the other cases.

except
TypeError

The exception is raised when cols has non-numeric columns.

Examples

from datatable import dt, f, rowsd DT = dt.Frame({'name': ['A', 'B', 'C', 'D', 'E'], 'group': ['mn', 'mn', 'kl', 'kl', 'fh'], 'S1': [1, 4, 5, 6, 7], 'S2': [2, 3, 8, 5, 1], 'S3': [8, 5, 2, 5, 3]}
DT
namegroupS1S2S3
str32str32int32int32int32
0Amn128
1Bmn435
2Ckl582
3Dkl655
4Efh713

Get the row standard deviation for all integer columns:

DT[:, rowsd(f[int])]
C0
float64
03.78594
11
23
30.57735
43.05505

Get the row standard deviation for some columns:

DT[:, rowsd(f[2, 3])]
C0
float64
00.707107
10.707107
22.12132
30.707107
44.24264

See Also

  • rowmean() – calculate the mean value row-wise.