Uppercase Country Codes

Easy
String Functions

Uppercase Country Codes

The customers table stores lowercase country codes.

Return customer_id, country_code with each code converted to uppercase. Sort by customer_id ascending.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.customers5 rows
customer_id (int)country_code (string)
1in
2us
3gb
4de
5ca

Return these columns

customer_id(int)
country_code(string)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.