xls = pd.ExcelFile(excel_file)
for sheet_name in ['本地XXX', '本地YYY', '肿瘤产品线', '地贫', 'cnv-seq', '单基因遗传病', 'PMseq', 'tNGS']:
    if sheet_name in xls.sheet_names:
        pass
    else:
        continue
    # df_tmp = parse_local(excel_file, sheet_name)
    df_tmp,wrong_price_sheet,wrong_price_df = parse_local(excel_file, sheet_name,start_date, end_date)
    if wrong_price_sheet:
        wrong_price_list.append((wrong_price_sheet,wrong_price_df))
    df_list.append(df_tmp)

这个比读取整个Excel(pd.read_excel(excel_file,sheet_name=none)),再来判断,其效率要高得多

更多推荐