I am trying to import n tables with a loop, giving a different name for each table.
I can write the code to import the tables but I can't give a different name for each table:
the path to find the files (csv)
totalbaseURL=('path')find all the csv files
folders = os.listdir(totalbaseURL)i.e.,
foldersbecomes["house","cars","food","pubs"].folderscontains the name of the csv filesfor f in folders: path=totalbaseURL+f table=pd.read_csv(path,delimiter=';')
How could I put, instead of "table"? I would like to use the names in folders: (house, cars, food, pubs).