Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find sum of values in a column that corresponds to unique vallues in another coulmn python

group = df.groupby('author')

df2 = group.apply(lambda x: x['subreddit'].unique())

# Alternatively, same thing as a one liner:
# df2 = df.groupby('author').apply(lambda x: x['subreddit'].unique())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #sum #values #column #corresponds #unique #vallues #coulmn #python
ADD COMMENT
Topic
Name
8+5 =