I am currently in the phase of data preparation and have a certain issue I would like to make easy.
The content of my columns: 10 MW / color. All the columns which have this content are named with line nr. [int] or a [str]
What I want to display and which is the data of interest is the color. What I did was following: df['columnname'] = df['columnname'].str.split('/').str[-1]
The problem which occurs is that this operation should be done on all columns which names start with the string "line". How could I do this?
I thought about doing it with a for-loop or a while-loop but I am quite unsure how to do the referencing in the data frame then since I am a nooby in python for now.
Thanks for your help!