import pandas as pd
import numpy as np
from datetime import datetime
df = pd.DataFrame(
{
'Date' : np.random.choice(pd.date_range(datetime(2020,1,1),periods=5),20),
'Product' : np.random.choice(['Milk','Brandy','Beer'],20) ,
'Quantity' : np.random.randint(10,99,20)
}
)
df.groupby(['Date','Product']).sum()
This will give,
I would like to get the max values of the sum within the group what is the best way to do it?
Expected result for my random sample value would be.
How can I achieve this result.

