load all csv files in a folder python pandas

Solutions on MaxInterview for load all csv files in a folder python pandas by the best coders in the world

showing results for - "load all csv files in a folder python pandas"
Juan Esteban
07 Apr 2017
1import pandas as pd
2import glob
3
4path = r'C:\DRO\DCL_rawdata_files' # use your path
5all_files = glob.glob(path + "/*.csv")
6
7li = []
8
9for filename in all_files:
10    df = pd.read_csv(filename, index_col=None, header=0)
11    li.append(df)
12
13frame = pd.concat(li, axis=0, ignore_index=True)