EasyAbout 8 minVectorization
Map codes to regions with a fallback
Given an orders DataFrame with a country column and a region_map dict (country code → region), return each row's region. Codes not in the map fall back to 'OTHER'.
Return a Python list in row order.
What the tests check
2 on Run · 3 on Submit01maps codes, unmapped -> OTHER
02repeated codes keep row order
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.
Runtime
Python 3.13 in your browser – the standard library plus pandas and numpy; no pip installs.