The column name in the excel file I have is having no space, it is written as follow:
ProjectNo, ProjectName, DocNo, DescriptionOfDesign
so I want to split the column name to be lowercase and separated with _ :
project_no, project_name, doc_no, description_of_design
I tried to use re.findall
df.columns = re.findall('[A-Z][^A-Z]*', [df.columns])
the error I got:
TypeError: expected string or bytes-like object
how should I write my script in order to get the desired column names?
thanks in advance.