【发布时间】:2019-11-16 22:58:01
【问题描述】:
我有这个数据框:
Name type1 type2 type3 ... typeN color
John 8.7 0 NA ... 56 blue
Andy 45 34 9.7 ... NA yellow
我需要把它改成这样:
color typeName Name value
blue type1 John 8.7
blue type2 John 0
blue type3 John NA
.
.
.
blue typeN John 56
yellow type1 Andy 45
yellow type2 Andy 34
yellow type3 Andy 9.7
.
.
.
yellow typeN Andy NA
我有点困惑如何做到这一点,请帮忙?
【问题讨论】: