My dataframe is similar to:
   transaction       date  cash
0            1 2020-01-01    72
1            2 2020-01-03   100
2            2 2020-01-05   -75
3            3 2020-01-05    82
I want the output to group by transaction and to sum the cash for each transaction (if there is two amounts) BUT ALSO to return the later date. So for transaction 2 the end result would show transaction, date, cash as: 2,1/5/2020, 25...
Not sure how to make tables to help the visuals in my question yet so sorry, please let me know if there's any questions.
 
     
    