FunctionRacerProblemsRace

Most Orders Customer

MediumpandasPython

customers has columns id and name (names are unique). orders has a column customer_id. Return the name of the customer with the most orders. If several tie, return the alphabetically first name. At least one order exists.

Example 1

customers {"id":[1,2],"name":["Ann","Bo"]}
orders {"customer_id":[2,2,1]}
returns "Bo"

Bo has 2 orders, Ann 1.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems