How can I convert columns to rows in Pandas?

前端 未结 3 1636
Happy的楠姐
Happy的楠姐 2021-01-23 16:48

I have something like this:

Values     Time
  22        0
  45        1
  65        2
  78        0
  12        1
  45        2

and I want this

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-23 17:18

    You need to transpose your array/matrix.

    Use

    list(map(list, zip(*l)))
    

    where list is your list

提交回复
热议问题