0

Assuming I have a string:

col_name = 'age'

I also have a data frame:

result

I would like to rename the dataframe as

age_data

My code is as follows:

col_name+'_data' = result

However (obviously) this doesn't work. I'm thinking I would have to convert col_name+'_data' into a python object (rather than a string) for it to work.

Aran-Fey
  • 35,525
  • 9
  • 94
  • 135
BlackHat
  • 707
  • 1
  • 10
  • 23

0 Answers0