ค้นหาชื่อลูกค้าที่มีสถานะการสั่งซื้อทั้ง "บนถนน" และ "จัดส่งแล้ว"
Find the names of the customers who have order status both "On Road" and "Shipped".
df_orders = pd.DataFrame(columns=['customer_id', 'order_status']); df_customers = pd.DataFrame(columns=['customer_name', 'customer_id'])
on_road_customers = df_customers.set_index('customer_id').join(df_orders[df_orders['order_status'] == 'On Road'].set_index('customer_id')).dropna()['customer_name']; shipped_customers = df_customers.set_index('customer_id').join(df_orders[df_orders['order_status'] == 'Shipped'].set_index('customer_id')).dropna()['customer_name']; pd.Series(list(set(on_road_customers).intersection(set(shipped_customers))))