我在下面的数据帧中,想将第3列后的列转置为行。请帮忙。
df:
country year perc data1 data2 data3
IN 2015 hjk 75 81 96
US 2015 KTM 100 289 632
Results:
country year perc TransposedColumn Value
IN 2015 hjk data1 75
IN 2015 hjk data2 81
IN 2015 hjk data3 96
US 2015 KTM data1 100
US 2015 KTM data2 289
US 2015 KTM data3 632
Run Code Online (Sandbox Code Playgroud)