I have many dataframes that are named the same except for a suffix. I need to perform the same operation on these dataframes and would like to streamline this process through a loop. I am trying to figure out how to reference the dataframes through a loop over the list of suffixes. For example, something along the lines of:
for i in [a,b,c,d,e]:
score_i=r2_score(df_i['col1'],df_i['col2']
and this would perform the same operation on all 5 dataframes and create 5 new variables. However, I'm not sure how to set this up without an error. Any advice would be appreciated - thanks!