0

How to get a variable name out of a List within a for loop.

example:

List = ['a','b','c','d']
for i in List:
    var_i_ = something

so for each letter in list there should be a new variable name like:

var_a_ = something
var_b_ = something
var_c_ = something
var_d_ = something

So i could call use it in pandas as well

List = ['a','b','c','d']
for i in List:
    df_i_ = something

df_a_ = something
df_b_ = something
df_c_ = something
df_d_ = something

each needs to be a different dataframe. I need it as a search function to save data as csv or something else.

JohnE
  • 29,156
  • 8
  • 79
  • 109
saveit
  • 7
  • 3

0 Answers0