Skip to content Skip to sidebar Skip to footer

Not Getting Back The Column Names After Reading Into An Xlsx File

Hello I have xlsx files and merged them into one dataframe by using pandas. It worked but instead of getting back the column names that I had in the xlsx file I got numbers as colu

Solution 1:

I hope I understood your question correctly. You just need to get rid of the index_col=None and it will return the column name as usual:

frames = [x.parse(x.sheet_names[0], header=None) for x in excels]

If you add index_col=None pandas will treat your column name as 1 row of data rather than a column for the dataframe.

Post a Comment for "Not Getting Back The Column Names After Reading Into An Xlsx File"