0

So I have a function func(field) that returns a DataFrame.

i have a list of 1000s of fields and want to loop and pass them all through the function and save each dataframe separately.

to simply here is a list of 3 fields:

fields = ['math','science','english']

for field in fields:
    field+df = func(field)

The idea is that i want to generate variables that contain the name of the field so that I can access the dataframe of any field at any time without having to loop through them all...

so it would be nice if I can just call mathdf or englishdf etc

cs95
  • 379,657
  • 97
  • 704
  • 746
BKS
  • 2,227
  • 4
  • 32
  • 53

0 Answers0