我正在尝试使用同事写的脚本.
这部分脚本工作正常:
xl = pd.ExcelFile(path + WQ_file)
sheet_names = xl.sheet_names
df = pd.read_excel(path + WQ_file, sheetname = 'Chemistry Output Table', skiprows = [0,1,2,4,5,6,7],
index_col = [0,1], na_values = ['', 'na', '-'])
df.index.names = ['Field_ID', 'Date_Time']
header = pd.read_excel(path + WQ_file, sheetname = 'header data',
index_col = [0], na_values = ['', 'na', ' - '])
header_dict = {ah: header['name_short'].loc[ah] for ah in header.index}
analytes_excel = pd.read_excel(path + WQ_file, sheetname = 'analytes', columns = 'name')
analytes_list = [item for sublist in analytes_excel.values.tolist() …Run Code Online (Sandbox Code Playgroud)