this is the data frame:
course_id weight
0 1 10
1 1 40
2 1 50
3 2 40
4 2 60
5 3 90
6 3 10
want to convert it to a dictionary like:
{1 : [10,40,50] , 2:[40,60] , 3 :[90,10]}
df = pd.read_csv(tests)
df = df[['course_id','weight']]
print(df)