Join on differently named keys

Data framesMedium9 min

Your task

Given orders with columns order_id, customer, amount, status and placed, and people with columns handle and city, join customer to handle and return order_id and city for the orders whose customer is known, sorted by order_id ascending.

Examples

orders_with_city(orders: dataframe, people: dataframe) -> dataframe
Example 1
Inputorders_with_city(orders, people)
orders
order_idcustomeramountstatusplaced
1ada120.5paid2024-01-05
2bo80refunded2024-01-07
3ada45.25paid2024-02-11
4cy200paid2024-02-14
5bo15.75pending2024-03-02
6ada60paid2024-03-19
people
handlecity
adaOslo
cyLima
Output
order_idcity
1Oslo
3Oslo
4Lima
6Oslo