如何将列表的一列转换为多列?

时间:2019-12-02 07:11:54

标签: python pandas dataframe

假定以下数据框df

    Player  |      Matches
---------------------------------------
0   Sachin    [110,97,130,140]
1   Kohli     [123,157,56,87]
2   Dhoni     [93,78,68,112]
3   Kapil     [79,94,112,76]
4   Rohit     [134,101,87,127]  
  

如何将列表的一列转换为多列?

预期/必需的输出

    Player  |Match1  |Match2 | Match3|Match4 |
----------------------------------------------
0   Sachin    110       97     130      140
1   Kohli     123      157      56       87
2   Dhoni     93        78      68      112
3   Kapil     79        94      112      76
4   Rohit     134      101      87      127  

0 个答案:

没有答案