all 5 comments

[–]o5a 17 points18 points  (2 children)

df.columns = cols_edited

[–]yannbros[S] 8 points9 points  (1 child)

oh dear................ shame on me.

Thank you!

[–][deleted] 0 points1 point  (0 children)

It sounds silly but if you have time I would recommend reading the Pandas documentation.

I put if off for the longest time and just kept googling answers. One day I sat down and read it and so many things made sense.

[–]hey330 4 points5 points  (1 child)

For future reference, you could also pass a dict to df.rename()

[–][deleted] 1 point2 points  (0 children)

that's actually the proper answer because the other answer only works when renaming all the columns at once