I've got the following dataframe (head shown here) and it's messy.
orig dest 1997 2002 2006 2010 2016 1997 2002 2006 2010 2016
Seoul Inchon 543 524 364 452 845 543 524 364 452 845
Seoul Gyeongi 543 524 364 452 845 543 524 364 452 845
Inchon Seoul 543 524 364 452 845 543 524 364 452 845
I want to convert my dataset into the following format (it has got 7000 observations and i have just shown the head of the dataset): I want to get (1997-2016 under one column named "cartrip") and (1997-2016 under another column named "walking")
Year orig dest cartrip walking
1997 Seoul Incheon 543 543
2002 Seoul Incheon 524 524
2006 Seoul Incheon 364 364
2010 Seoul Incheon 452 452
2016 Seoul Incheon 845 845
1997 Seoul Gyeongi 543 543
2002 Seoul Gyeongi 524 524
2006 Seoul Gyeongi 364 364
2010 Seoul Gyeongi 452 452
2016 Seoul Gyeongi 845 845
I tried to gather but it didn't work.