pandas read rotated csv files

Posted by EricCoding on Stack Overflow See other posts from Stack Overflow or by EricCoding
Published on 2014-06-09T21:15:57Z Indexed on 2014/06/09 21:24 UTC
Read the original article Hit count: 237

Filed under:
|

Is there any function in pandas that can directly read a rotated csv file?

To be specific, the header information in the first col instead of the first row. For example:

A 1 2
B 3 5
C 6 7

and I would like the final DataFrame this way

A B C
1 3 5
2 5 7

Of corse we can get around this problem using some data wangling techniques like transpose and slicing. I am wondering there should be a quick way in API but I could not find it.

© Stack Overflow or respective owner

Related posts about python

Related posts about pandas