Learn by fixing tests
© 2025-2026 Alex Cole. All Rights Reserved.
Spark Koans is an independent community tool.
Pivot data from rows to columns. Replace ___ with the correct code.
___
data = [ ("Alice", "Q1", 100), ("Alice", "Q2", 150), ("Bob", "Q1", 200), ("Bob", "Q2", 180) ] df = spark.createDataFrame(data, ["name", "quarter", "sales"])
Output will appear here...