open-cogsci/datamatrix

operations.split() should be able to take multiple columns to split by

Closed this issue · 0 comments

The following example should work such that the DataMatrix is split by each unique combination of dm.col1 and dm.col2.

from datamatrix import operations as ops
dm = DataMatrix(length=4)
dm.col1 = 'a', 'a', 'b', 'b'
dm.col2 = 'c', 'd', 'c', 'd'
for val1, val2, sdm in ops.split(dm.col1, dm.col2):
    pass