I have a dataframe with IDs and booking refs, looking like the simplified example below.
| ID | BookingRef |
|---|---|
| 001 | 2019/32323 |
| 002 | 2011/23232 |
| 002 | 2017/7u4922 |
In the above example, 001 has one booking and 002 has two bookings in total so the average number of bookings for customers is 1.5.
How could I calculate this for millions of records using python and pandas?