2
I need to remove duplicate dates from the dataframe and add the values corresponding to those dates.
I found an answer in the NA stack that approaches what I need, but I couldn’t shape it for my need:
df.groupby('data', group_keys=False).apply(lambda x: x.loc[x.valor.idxmax()])
Only instead of grouping by date and keeping the higher value, I need to keep the sum of the values, not just the higher value.