I have a dataframe called df_cv with column that contains this string _log. I would like to delete _log from the name of each column in a dataframe So i didlike this :
modify_cols=[]
for c in df_cv.columns:
if c.find("_log") != -1:
modify_cols.append(c)
for c in modify_cols:
c = c.replace('_log',' ')
But it didn't work , there is no error message but the comluns name doesn't change.
Any idea please to help me?
Thanks
df_cv.columns=df_cv.columns.str.strip('_log')??_, l, o, g