0

I am trying to use a loop to create multiple dataframes from CSV files The issue I am facing is naming the dataframe at the end with a variable.

list = [1.csv, 2.csv, 3.csv]

from x in list:
   name = x.split('.')
   name = pd.read_csv(x)

How do I make the name of the dataframe 1 , 2, 3 ?

juanpa.arrivillaga
  • 88,713
  • 10
  • 131
  • 172
Lko
  • 252
  • 4
  • 12

0 Answers0