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
  • 330,695
  • 80
  • 606
  • 657
BKS
  • 1,977
  • 3
  • 24
  • 48

0 Answers0