I want to change the column name of the dataframe which has 128 coloumns. I want to iteratively change it. Example, I want it to be facefeat_1,facefeat_2,.....facefeat_128. Help would be appreciated. Thank you
Asked
Active
Viewed 125 times
0
-
`df.columns = [f'facefeat_{x}' for x in range(1,129)]` ? – Umar.H Aug 24 '20 at 08:30
1 Answers
1
Assume that df
is your DataFrame
variable. It should be like this.
df.columns = ['facefeat_'+str(i) for i in range(1,129)]

gunsodo
- 175
- 1
- 10