cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Separate words in column name

vsunilbabu
New Contributor II

Hello,

Can you please help separating my column names using โ€˜_โ€™ whenever there are capital letters in the column name.

For example:
Input
image

Output
image

In my research, I understood that findall() function can help iterating through all column names, using the logic: output.append(โ€œ_โ€.join(re.findall(โ€˜[A-Z][^A-Z]*โ€™, i)))

Can someone help me with a script for this? Or if there is any other better way.

Thanks,
Sunil

2 REPLIES 2

kchaitanya
Employee
Employee

Hi Sunil,

Please use the attached pipeline to read a csv and update the column names with the conversion you asked for.

Column_Name_2019_09_27.slp (9.3 KB)

Thanks,
Chaitanya

Thank you Chaitanya.