Here's something that I can never remember how to do in Pandas: group by 1 column (e.g. Account ID) and sum another column (e.g. purchase price). So, here's an example for our reference:
data.groupby(by=['account_ID'])['purchases'].sum()
Simple, but not worth re-Googling each time!
small but useful comment. Thanks!
ReplyDeletegood
ReplyDeleteThanks a lot !
ReplyDelete