or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

core-data-structures.mddata-manipulation.mdexpression-system.mdfile-io.mdindex.mdmathematical-functions.mdreductions-aggregations.mdrow-operations.mdset-operations.mdstring-operations.mdtime-operations.mdtype-system.md

row-operations.mddocs/

0

# Row-wise Operations

1

2

Element-wise operations across columns within rows for complex transformations and calculations.

3

4

## Capabilities

5

6

### Row-wise Aggregation Functions

7

8

```python { .api }

9

def rowall(*cols):

10

"""Row-wise all (logical AND across columns)"""

11

12

def rowany(*cols):

13

"""Row-wise any (logical OR across columns)"""

14

15

def rowcount(*cols):

16

"""Row-wise count of non-missing values"""

17

18

def rowsum(*cols):

19

"""Row-wise sum across columns"""

20

21

def rowmean(*cols):

22

"""Row-wise mean across columns"""

23

24

def rowmin(*cols):

25

"""Row-wise minimum across columns"""

26

27

def rowmax(*cols):

28

"""Row-wise maximum across columns"""

29

30

def rowsd(*cols):

31

"""Row-wise standard deviation across columns"""

32

33

def rowfirst(*cols):

34

"""Row-wise first non-missing value"""

35

36

def rowlast(*cols):

37

"""Row-wise last non-missing value"""

38

39

def rowargmin(*cols):

40

"""Row-wise index of minimum value"""

41

42

def rowargmax(*cols):

43

"""Row-wise index of maximum value"""

44

```

45

46

## Examples

47

48

```python

49

import datatable as dt

50

51

DT = dt.Frame({

52

'A': [1, 2, None, 4],

53

'B': [2, None, 3, 5],

54

'C': [3, 4, 5, None]

55

})

56

57

# Row-wise operations

58

result = DT[:, dt.update(

59

sum_abc=dt.rowsum(f.A, f.B, f.C),

60

mean_abc=dt.rowmean(f.A, f.B, f.C),

61

min_abc=dt.rowmin(f.A, f.B, f.C),

62

max_abc=dt.rowmax(f.A, f.B, f.C),

63

count_abc=dt.rowcount(f.A, f.B, f.C)

64

)]

65

```