Reputation: 27387
The request is to merge multiple DataFrames with duplicated "key" and accumulate the value associated with the key to a "master" DataFrame.
Is there a Pandas way to achieve the goal? Beside iterate every row and find the value based on the key OR using df.duplicated('ID', keep = False
to find all duplicated keys and then adding the values to the "master" DataFrame.
My attempt was
pd.concat(dfs).duplicated('ID', keep = False)
Upvotes: 2
Views: 130