I have a list of dataframes I have saved in a variable x.
x=[df_1963,df_1974,df_1985,df_1996,df_2007,df_2018]
I wish to change all the headers to lowercase but nothing happens after the running the code below.
for df in x:
for column in df.columns:
df = df.withColumnRenamed(column, '_'.join(column.split()).lower())