Skip to content
Advertisement

Appending row to dataframe with concat()

I have defined an empty data frame with

JavaScript

and want to append rows in a for loop like this:

JavaScript

But I get this error

JavaScript

If I use df = df.append(row, ignore_index=True), it works but it seems that append is deprecated. So, I want to use concat(). How can I fix that?

Advertisement

Answer

You can transform your dict in pandas DataFrame

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