-2

I have a question to use pandas. I have a table like this :

0 A B C D

1 S D F G

......

and every element of first line is the index of every column.

But I want to add a line at the top of the table, and I want the new line to be the index of the table of every colomn, how should I do ? Thanks!!!!

  • This really isn't enough information and your question is confusing. You should try to give us some sample data to work with, how did you get that table from the start? df.columns = column names. – Anton vBR Oct 28 '17 at 17:59

1 Answers1

0

Can't comment due to rep but I am fairly confident this is a duplicate and you can find your answer here:

Convert row to column header for Pandas DataFrame,

Kevinj22
  • 966
  • 2
  • 7
  • 11