import pandas as pddef sales_person(sales_person: pd.DataFrame, company: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:try:# 找到名为 "RED" 的公司的 com_idred_company_id = company[company['name'] == 'RED']['com_id'].values[0]# 找到与名为 "RED" 的公司相关的订单的销售人员red_orders_sales_ids = orders[orders['com_id'] == red_company_id]['sales_id']# 找到没有与 "RED" 公司相关的订单的销售人员result = sales_person[~sales_person['sales_id'].isin(red_orders_sales_ids)]['name']# 将 Series 转换为 DataFrameresult_df = result.to_frame(name='name')return result_dfexcept IndexError:# 当找不到匹配的公司时返回所有销售人员的列表return sales_person[['name']]