Min / Max Price Per Product

Easy
GroupBy
Aggregations
Flipkart

Min / Max Price Per Product

Compute min_price and max_price per product_id. Sort by product_id asc.

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.prices12 rows
product_id (int)price (double)
4318.64
4278.52
153.4
3260.03
2307.91
1218.57
3239.13
270.19
3390.71
3168.77
310.41
244.87

Return these columns

product_id(int)
min_price(double)
max_price(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.