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
  • 39,665
  • 11
  • 104
  • 149
BlackHat
  • 736
  • 1
  • 10
  • 24

0 Answers0