I tried to create the loop in python. The code can be seen below.
df=pd.DataFrame.copy(mef_list)
form=['','_M3','_M6','_M9','_M12','_LN','_C']
for i in range(0, len(form)):
df=pd.DataFrame.copy(mef_list)
df['Variable_new']=df['Variable']+str(form[i])
When I run the code, the result is only from the last loop, which is variable+'_C' I think it is because the data frame (df) is always replaced when the new loop start. In order to avoid the issue, I would think that if the data frame (df) could be renamed by plus the number of loop, the problem would be solved.
I used str function and hope to get df0, df1, ...,df6 but it doesn't work with the data frame name. Please suggest me how to change the name of data frame by add number of loop and also I still open for any alternative way.
Thanks!