1import glob, os
2import pandas as pd
3df = pd.concat(map(pd.read_csv, glob.glob(os.path.join('', "*.csv"))))
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')