I have a list of dataframes with these columns
Color Date Fruit Num
all have same columns.
I need to re-arrange columns. However, for loop doesn't seem to work.
for i in [df1,df2,df3,df4,df5,df6]:
i = i[['Date','Fruit','Num','Color']]
this way
df1 = df1[['Date','Fruit','Num','Color']]
it changes columns order but why not in loop. Isn't i every time looping through each dataframe and assigning reorder of column names.
Any advice?