I am trying to turn all my column headers to lower cases simultaneously over multiple dataframes.
Something close like this:
I have tried:
df_list = [df1.columns, df2.columns, df3.columns]
df1.columns, df2.columns, df3.columns = \
(df.apply(lambda x: x.str.lower()) for df in df_list)
and this:
for df in df_list:
df1.columns, df2.columns, df3.columns = \
map(str.lower, df.columns)
and:
df1.columns, df2.columns, df3.columns = (df.map(str.lower, df.columns) for df in [df1, df2, df3])
I do not really understand the concept of multiple variable assignments in this context (the LHS in my tries and compared to this: a, b = [True, False])
So, how do I run a function over multiple dataframes?