Skip to content
Advertisement

pandas.concat two data frames (one with and one without headers)

I have two data frames, that I am trying to combine.

A json file with headers:

JavaScript

And an Excel file with data in the same format, but without headers:

JavaScript

I am trying to achieve the data frame below:

JavaScript

My code:

JavaScript

Problem: When I run my code, the combined data frame looks like this:

JavaScript

I have tried the concat function with a few attributes already like ignore_index=True, but nothing worked so far.

Advertisement

Answer

Just try with

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement