import os
import pandas as pd
qx_xlsx_path = r'C:\Users\weatherFile\xlsx' # 里面是多个sheet的excel文件
files = os.listdir(qx_xlsx_path)
fst = True
meto_dict = {}
for f in files:
df_dict = pd.read_excel(qx_xlsx_path + '\\' + f, sheet_name=None, index_col= 2)
if len(df_dict) <= 1:
continue
if fst:
fst = False
for fm in df_dict:
meto_dict[fm] = df_dict[fm].iloc[10:60, :]
else:
for fm in df_dict:
if fm !='Sheet1':
base = meto_dict[fm].index
中间的两个 if 判断不明白什么意思,有懂得帮忙解答下吗,万分感谢!
meto_dict[fm] = df_dict[fm] 这种用法也不明白