Here is a sample dataframe.
import pandas as pd
d = {'id': ['101', '101', '101', '105', '105'],
'qty': [10, 15, 20, 50, 55],
}
df31 = pd.DataFrame(data=d)
df31
id qty
0 101 10
1 101 15
2 101 20
3 105 50
4 105 55
How to get results like this?
