(It is a story assuming Jupyter Notebook.)
What to do if the data in the first row of the DataFrame gets into the header (columns) for some reason.
It's easy to read again or rebuild the DataFrame, If you want to fix it with code somehow, I summarized how to fix it with DataFrame.
For example, consider the case where the data in the first line is originally included in the header part as shown below.
I want to insert [a, 0] in the header at the position of index = 0, but pandas doesn't seem to have such a function, so process it as follows.
df = df.shift() #Shift the row data downward one by one df.iloc = df.columns.values #index=Originally substitute the data of the first line at the position of 0 df.columns = ["col1", "col2"] #Set the original column name