ค้นหาชื่อลูกค้าที่มีนโยบายรอง
Find the names of the customers who have an deputy policy.
df_customers = pd.DataFrame(columns = ['customer_id', 'customer_details']); df_policies = pd.DataFrame(columns = ['policy_type_code', 'customer_id'])
customer_ids = df_policies.loc[df_policies['policy_type_code'] == 'Deputy', 'customer_id']; result = df_customers.loc[df_customers['customer_id'].isin(customer_ids), 'customer_details']