这个问题在这里已经有了答案:
Find the column name which has the maximum value for each row
(3 个回答)
1年前关闭。
我想转换一个看起来像这样的表:
Blue Green Red
Thing 1 No Yes No
Thing 2 Yes No No
Thing 3 Yes No No
进入这种风格:
Color
Thing 1 Green
Thing 2 Blue
Thing 3 Blue
在 python 或 Pandas 中有没有一个很好的方法来做到这一点?这些表格样式有名称吗?
最佳答案
关于python - 将多个虚拟变量转换为一列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59184362/