← All courses
PySpark: Practical DataFrames
Learn PySpark by writing it - the DataFrame API end to end: select and filter, aggregation, joins, window functions, complex/nested data, Spark SQL, and reading/writing files. Every code box runs right in your browser (real pyspark.sql on DuckDB), with a graded exercise in every lesson.
intermediate
Free
pysparksparkdataframesbig-datapython
📖 44 readings
⚡ 44 exercises
· 175 min total
10 modules · 44 lessons
▸
0. Getting Started
4 lessons · 19 min
-
1
What runs here — and how to read a lesson
5 min
-
2
SparkSession and your first DataFrame
5 min
-
3
Transformations, actions, and lazy evaluation
5 min
-
4
Schemas: inferred vs explicit
4 min
▸
1. DataFrame Essentials — the core verbs
6 lessons · 25 min
-
5
`select` — choose and compute columns
4 min
-
6
Referring to columns: `col`, `expr`, `lit`
4 min
-
7
`filter` / `where` — keep the rows you want
4 min
-
8
`withColumn`, `withColumnRenamed`, `drop`
4 min
-
9
`cast` — changing a column's type
4 min
-
10
`orderBy`, `distinct`, `dropDuplicates`, `limit`
5 min
▸
2. Aggregation & Grouping
4 lessons · 13 min
-
11
`groupBy` and `agg` — summarizing data
4 min
-
12
Multiple aggregates, aliasing, and filtering groups
3 min
-
13
Conditional aggregation and `pivot`
3 min
-
14
Aggregating into lists: `collect_list` and `collect_set`
3 min
▸
3. Columns in the Real World — strings, dates, nulls, conditionals
4 lessons · 18 min
-
15
String functions
4 min
-
16
Date and time functions
4 min
-
17
Handling nulls
6 min
-
18
Conditional logic: `when` / `otherwise`
4 min
▸
4. Joins
5 lessons · 20 min
-
19
Inner join
4 min
-
20
Left, right, and full outer joins
4 min
-
21
Semi and anti joins — filtering with a join
4 min
-
22
Cross joins, self-joins, and ambiguous columns
4 min
-
23
Diagnosing wrong row counts
4 min
▸
5. Window Functions
5 lessons · 19 min
-
24
The window spec — `partitionBy` and `orderBy`
4 min
-
25
Ranking: `row_number`, `rank`, `dense_rank`, `ntile`
3 min
-
26
Analytic functions: `lag`, `lead`, `first`, `last`
4 min
-
27
Frames: running totals and moving averages
4 min
-
28
Practical window patterns
4 min
▸
6. Complex & Nested Data
5 lessons · 24 min
-
29
Arrays: `explode`, `size`, `array_contains`
5 min
-
30
Higher-order functions on arrays
6 min
-
31
Structs — nested records
5 min
-
32
Maps — key/value columns
4 min
-
33
JSON in a column: `from_json` and `to_json`
4 min
▸
7. Spark SQL — the other half of the API
3 lessons · 9 min
-
34
Temp views and `spark.sql`
3 min
-
35
SQL vs the DataFrame API — same engine
3 min
-
36
When to use which — and proof they're the same
3 min
▸
8. Reading & Writing Data
4 lessons · 15 min
-
37
Reading and writing CSV
4 min
-
38
Reading and writing JSON
3 min
-
39
Parquet — the format you should default to
3 min
-
40
Schema on read — infer vs. declare
5 min
▸
9. Capstone Projects — writing real PySpark
4 lessons · 13 min
-
41
Capstone 1 — clean a messy orders feed
3 min
-
42
Capstone 2 — customer analytics
3 min
-
43
Capstone 3 — flatten a nested clickstream
3 min
-
44
Capstone 4 — rewrite a SQL report as a DataFrame pipeline
4 min
0 Comments