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
  • 77,035
  • 9
  • 115
  • 152
Lko
  • 224
  • 3
  • 12

0 Answers0