1. 按条件筛选Excel中特定的数据(如只显示'result'列的值为‘pass’或‘fail’的数据)
ex_df = pd.read_excel('./test',sheet_name = 'resultInfo')
ex_df = ex_df[ex_df['result'].isin(['pass','fail'])]
# 反选,除了‘pass’和‘fail’的所有数据
ex_df = ex_df[~ex_df['result'].isin(['pass','fail'])]
1. 按条件筛选Excel中特定的数据(如只显示'result'列的值为‘pass’或‘fail’的数据)
ex_df = pd.read_excel('./test',sheet_name = 'resultInfo')
ex_df = ex_df[ex_df['result'].isin(['pass','fail'])]
# 反选,除了‘pass’和‘fail’的所有数据
ex_df = ex_df[~ex_df['result'].isin(['pass','fail'])]