📜  使用 glob 读取所有 excel - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:07.361000             🧑  作者: Mango

代码示例1
import sys
import csv
import glob
import pandas as pd

# get data file names
path =r'C:\DRO\DCL_rawdata_files\excelfiles'
filenames = glob.glob(path + "/*.xlsx")

dfs = []

for df in dfs: 
    xl_file = pd.ExcelFile(filenames)
    df=xl_file.parse('Sheet1')
    dfs.concat(df, ignore_index=True)