DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
1+3 =
Submit