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

1

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())
Posted by: Guest on June-14-2021

Code answers related to "find sum of values in a column that corresponds to unique vallues in another coulmn python"

Python Answers by Framework

Browse Popular Code Answers by Language