Learn by fixing tests
© 2025-2026 Alex Cole. All Rights Reserved.
Spark Koans is an independent community tool.
Group data and calculate aggregates. Replace ___ with the correct code.
___
data = [ ("Sales", "Alice", 5000), ("Sales", "Bob", 4500), ("Engineering", "Charlie", 6000), ("Engineering", "Diana", 6500), ("Engineering", "Eve", 5500) ] df = spark.createDataFrame(data, ["department", "name", "salary"])
Output will appear here...