1import os
2import glob
3import pandas as pd
4os.chdir("/mydir")
5
6extension = 'csv'
7all_filenames = [i for i in glob.glob('*.{}'.format(extension))]
8
9#combine all files in the list
10combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ])
11#export to csv
12combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig')
1path = r'C:\DRO\DCL_rawdata_files' # use your path
2all_files = glob.glob(path + "/*.csv")
3
4li = []
5
6for filename in all_files:
7 df = pd.read_csv(filename, index_col=None, header=0)
8 li.append(df)
9
10frame = pd.concat(li, axis=0, ignore_index=True)