I have the following 3 dataframes:
I want to append df_forecast to each of df2_CA and df2_USA using a for-loop. However when I run my code, df_forecast is not appending: df2_CA and df2_USA appear exactly as shown above.
Here’s the code:
df_list=[df2_CA, df2_USA]
for x in df_list:
pd.concat([x, df_forecast])
x['prod'].fillna(method='ffill',inplace=True)
x['country'].fillna(method='ffill',inplace=True)
x.loc['2020-03':'2020-05', 'rev'] = 200
And here is the desired result:
What's wrong with my code?