I am trying to make a copy of the columns names , then manipulate these names using a for loop.
in this or loop I want to lower all letter using .lower(), and separate the words using underscore.
how can I do this?
You can do this:
cols = pl.columns.to_list()
cols_modified = []
for col in cols:
col = col.lower().replace(' ', '_')
cols_modified.append(col)
Let me know if it worked.