I have 5 dataframes A through E and I'd like to apply the same process to all frames. I've executed a loop but it doesn't overwrite the original dataframes I'd like to change, they result as identical to the frames I've fed to the loop:
frames = [A,B,C,D,E]
for df in frames:
df = df[df.columns.drop(list(df.filter(regex='Unnamed')))] # Drop columns with "Unnamed" in column name
df = df.apply(lambda x: x.astype(str).str.upper()) # Convert columns to caps
df['Unique Name'] = df['Name'] + ' ' + df['Gender'] + ' ' + df['Classification'] + ' ' + df['Silhouette']
The exact same code works if I run it individually for each dataframe.