Convert row to column header for Pandas DataFrame,
In [21]: df = pd.DataFrame([(1,2,3), (‘foo’,’bar’,’baz’), (4,5,6)]) In [22]: df Out[22]: 0 1 2 0 1 2 3 1 foo bar baz 2 4 5 6 Set the column labels to equal the values in the 2nd row (index location 1): In [23]: df.columns = df.iloc[1] If the index has unique labels, you can drop … Read more