Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

group by 2 unique attributes pandas

import numpy as np
g = df.groupby('c')['l1','l2'].apply(lambda x: list(np.unique(x)))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #group #unique #attributes #pandas
ADD COMMENT
Topic
Name
1+3 =