Want to remove common pattern from column names.

Himanshu_Pant
New Altair Community Member
I have a datset which contain a common pattern across all the column name. E.g.
average(column1) average(column2) average(column3) average(column4).
I want column name like:
column1 column2 column3 column4
so how to remove, average() from each column name.
P.S. Please suggest a way without using a loop. If not, than loop will also work.
average(column1) average(column2) average(column3) average(column4).
I want column name like:
column1 column2 column3 column4
so how to remove, average() from each column name.
P.S. Please suggest a way without using a loop. If not, than loop will also work.
Tagged:
0
Best Answer
-
use rename by replace, and replace average\((.*)\) with $12
Answers
-
use rename by replace, and replace average\((.*)\) with $12