Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to read multiple csv file from different directory in python

import csv
import pandas

df_list = []
path = "C:/Users/bubai/Desktop/try/scrapy/output"
#all csv file
for file in os.listdir(path):
    #print(file)
    df_list.append(file)  # all csv file in this
#print(df_list) 
for i in df_list:
    df = pandas.read_csv(i)  # open one by one 
    print(df)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #multiple #csv #file #directory #python
ADD COMMENT
Topic
Name
8+2 =