PySpark Koans

Learn by fixing tests

Progress0/39

© 2025-2026 Alex Cole. All Rights Reserved.

Spark Koans is an independent community tool.

BasicsKoan 1

Creating a DataFrame

Learn how to create a DataFrame from Python data structures. Replace ___ with the correct code.

Setup (read-only)
data = [("Alice", 34), ("Bob", 45), ("Charlie", 29)]
columns = ["name", "age"]
Your CodeCtrl/Cmd+Enter to run
Output
Output will appear here...