datatable.rowcount()

For each row, count the number of non-missing values in cols.

Parameters

cols
FExpr

Input columns.

return
FExpr

f-expression consisting of one int32 column and the same number of rows as in cols.

Examples

from datatable import dt, f DT = dt.Frame({"A": [1, 1, 2, 1, 2], "B": [None, 2, 3, 4, None], "C":[True, False, False, True, True]}) DT
ABC
int32int32bool8
01NA1
1120
2230
3141
42NA1

Note the exclusion of null values in the count:

DT[:, dt.rowcount(f[:])]
C0
int32
02
13
23
33
42

See Also

  • rowsum() – sum of all values row-wise.