Skip to content
Advertisement

Appending Dataframe in for loop is not working

I’m getting crazy with that. I don’t know why is not working well.

My loop is the following:

JavaScript

In the first print I obtain:

JavaScript

But when I show the following dataframe value:

JavaScript

I obtain:

JavaScript

So it seems that is only concatenating the last value.

PD: See charge column in order to see differences between dataframes.

Thank you so much!

Advertisement

Answer

You are using v_df.loc[0] so it only shows the df with key 0. I think if you print v_df it will show all of them.

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