0

I want to name my dataframes in a loop.

This doesn't solve my problem in my understanding because I want to change my dataframes'n names not my columns's names.

So, I'd like to do something like this :

dfx = [df123, df456]
names = [678, 01011]

for i, df in enumerate(dfx): 
    "df" + str(names[i]) = df.drop.loc[:,"column"]

It seems basic but I don't know what to look for. There must be something to do with regex but I don't know where to look or to start.

Learning is a mess
  • 7,479
  • 7
  • 35
  • 71
sam
  • 47
  • 4

1 Answers1

1

I'm not sure for what purpose this could be needed, but I think you can instead of having many data frames with different names, you can add your data frames in a list, that list could have your different data frames, or maybe a Dict can help you to name each of your element(data frame).

dmaon
  • 58
  • 9