如何在Python中将数据框行堆叠为列?

时间:2019-06-19 02:52:19

标签: python-3.x pandas dataframe

我正在尝试将“区域”行熊猫数据框分解为多列,我想知道是否存在一种有效的方法?谢谢

     Location Date        Temp   Region
     Iowa     26         34.95  North
     Iowa     26         41.11  South
     Iowa     26         25.21  East
     Iowa     26         28.81  West
     Arkansas 31         35.32  North
     Arkansas 31         43.13  South



     Location Date        North    South     East     West
     Iowa     26         34.95    41.11     25.21    28.21   
     Arkansas 31         35.32    43.13       -        -

0 个答案:

没有答案