Orders in an Amount Band

Easy
Filtering

Orders in an Amount Band

The orders table contains order amounts.

Return order_id, amount for orders with an amount from 50 to 150 inclusive. Sort by order_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.orders7 rows
order_id (int)amount (double)
149.99
250
375
4150
5150.01
6120
720

Return these columns

order_id(int)
amount(double)

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.