This is the code I\'m currently using to group by a person, and calculate expanding mean based on the data being sorted in date order:
df = pd.DataFrame({\'da