Skip to content
Advertisement

Concat multiple small DataFrames as one big DataFrame

I’m trying to make a large DataFrame from a bunch of smaller DF. so I’ve look at multiple sites a nd they all mention to use the pd.concat() method and create an empty DataFrame. I did, however when I print inside my for loop I still get data as if it was still sectioned by individual DataFrame, and when i print my (now supposedly filled DataFrame ) I get an empty DF.

Note: All tables have the same structure

JavaScript

what I’m currently getting:

JavaScript

What I want:

JavaScript

Advertisement

Answer

Try:

JavaScript

If you want to loop and modify your data, you can collect them all in a list and use concat after the loop:

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