- PySpark Cookbook
- Denny Lee Tomasz Drabas
- 42字
- 2025-04-04 16:35:18
.count() action
The count() action returns the number of elements in the RDD. See the following code:
(
flights
.zipWithIndex()
.filter(lambda (row, idx): idx > 0)
.map(lambda (row, idx): row)
.count()
)
This will produce the following result:
# Output
1391578