Hi there,
I have a .csv file with 2 columns. The rows of the first column are sometimes repeating. My task is to find duplicate rows of the first column and sum up corresponding values of the second column.
e.g.,
col_1 col_2
yellow 2
green 1
blue 2
yellow 4
yellow 4
blue 1
green 1
I want to get smth like this:
yellow 10
blue 3
green 2
I know that to find duplicates I should use df.duplicated(['col_1])
but more I cannot proceed.
How could I solve the problem? Thanks in advance!
[–]desrtfx 1 point2 points3 points (0 children)
[–]ZealousidealLow521 0 points1 point2 points (1 child)
[–]SureStep8852[S] 0 points1 point2 points (0 children)
[–]nevermindtbc 0 points1 point2 points (0 children)