Total Project Hours

Easy
Aggregation

Total Project Hours

The time_entries table records hours logged against projects.

Return project, total_hours, rounded to 2 decimal places. Sort by project 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.time_entries7 rows
entry_id (int)project (string)hours (double)
1Alpha3.5
2Beta2
3Alpha4.25
4Gamma1.5
5Beta6
6Alpha0.75
7Gamma2.5

Return these columns

project(string)
total_hours(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.