Consider the following table:
tabb = {{1, 2, 3, 4}, {5, 1, 7, 8}, {1, 2, 3, 4, 13, 16}, {5, 6, 7, 9}, {1, 2, 3, 4, 11, 16}, {5, 6, 7, 8}, {1, 2, 3, 4, 11, 16, 13, 35}, {1, 1, 3, 4, 11, 16, 13, 35}, {1, 1, 14, 8, 33, 8, 13, 35}};
Could you please tell me how to group it by the number of columns and also the product of each second column?
I.e., the rows {{1, 2, 3, 4}, {5, 1, 7, 8}, {5, 6, 7, 9},{5, 6, 7, 8}}
of tabb
have the same number of columns, but the products of the 2nd and 4th columns are different. Therefore, they should be considered as different elements: the first two rows form one element, while the remaining two form another two elements.
I probably should use GroupGy[tabb,{Length,condition}]
where condition
specifies the product of the columns. My problem is that I cannot generalize the condition to an arbitrary number of columns.