I would like to transpose the structure of this df, I was wondering about pivot table, group by etc., but not sure of the best option, please
#original df
raw_data = {'name': ['A','A','A','A'],
'date' : pd.to_datetime(pd.Series(['2017-04-03','2017-04-03','2017-03-31','2017-03-31'])),
'order_1': [2,1,4,2],
'order_2': [5,1,3,0,]}
df = pd.DataFrame(raw_data, columns = ['name','date','order_1','order_2'])
df
#desired new df structure
raw_data2 = {'name': ['A','A','A','A','A','A','A','A'],
'date' : pd.to_datetime(pd.Series(['2017-04-03','2017-04-03','2017-04-03','2017-04-03','2017-03-31','2017-03-31','2017-03-31','2017-03-31'])),
'product': ['order_1','order_2','order_1','order_2','order_1','order_2','order_1','order_2'],
'sum': [2,5,1,1,4,3,2,0]}
desired_data = pd.DataFrame(raw_data2, columns = ['name','date','product','sum'])
desired_data```