📅  最后修改于: 2022-03-11 14:45:58.980000             🧑  作者: Mango
import os, glob
import pandas as pd
os.chdir(os.path.dirname(__file__) + r"\CSVs")
extension = 'csv'
all_filenames = [i for i in glob.glob('*.{}'.format(extension))]
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames ])
os.chdir(os.path.dirname(__file__))
combined_csv.to_csv( "combined_csv.csv", index=False, encoding='utf-8-sig')