I have 2 dataframes in a list, I mean Intraday_Mape and Day_Ahead_Mape are dataframes. These dataframes contains hourly data but I want to change them into monthly data. When I am doing this, I want to use for loop because, I ll deal with more dataframes in the future.
report_dfs = [Intraday_Mape, Day_Ahead_Mape]
for i, _ in enumerate(report_dfs):
report_dfs[i]=report_dfs[i].index.name = Date
report_dfs[i]=report_dfs[i].resample( M ).mean().reindex(annual_date_range, fill_value = 0)
report_dfs[i]=report_dfs[i].round(2)
When I print Intraday_Mape, I have still hourly data, it is not change. How can I achieve modified dataframes out of the for loop? I mean, when I print Intraday_Mape:
print(Intraday_Mape)
I got old one. How do I permanently change these datasets outside of the for loop?