A fairly beginner-level pandas question here.
I have a DataFrame of transactions:
Customer Date Amount
Angus 2009-07-18 $76.46
Bruno 2009-07-21 $68.66
Danno 2009-07-25 $73.52
Chapp 2009-07-11 $56.04
Chapp 2009-07-21 $11.30
Frank 2009-07-07 $52.86
Chapp 2009-07-09 $97.82
Danno 2009-07-11 $84.98
(etc. for thousands of lines)
I'd like to create four DataFrames from this data:
- For each customer, the customers name, how many transactions they've done, and the sum of the Amounts of these transactions
- For each customer, the date and amount of their most recent transaction.
- For each customer, the date and amount of their first transaction.
- For each customer, the date and amount of their largest (amount-wise) transaction.
Can you advise me on the appropriate code?
(Answers along the lines of "Why are you using DataFrames? You should be using ThnargLopes for this!" will be warmly received.)