- PySpark Cookbook
- Denny Lee Tomasz Drabas
- 68字
- 2021-06-18 19:06:40
.take(...) action
We have already discussed this, but, for the sake of completeness, the take(n) action returns an array with the first n elements of the RDD. Look at the following code:
# Print to console the first 3 elements of
# the airports RDD
airports.take(3)
This will generate the following output:
# Output
[[u'City', u'State', u'Country', u'IATA'],
[u'Abbotsford', u'BC', u'Canada', u'YXX'],
[u'Aberdeen', u'SD', u'USA', u'ABR']]
推薦閱讀
- 我的第一本算法書
- Learning SQLite for iOS
- Internet of Things with the Arduino Yún
- Data Analysis with Stata
- Building an RPG with Unity 2018
- Bootstrap 4 Cookbook
- Swift 4從零到精通iOS開發(fā)
- Orchestrating Docker
- Elasticsearch Essentials
- INSTANT JQuery Flot Visual Data Analysis
- Python深度學(xué)習(xí)(第2版)
- Mastering JavaScript Promises
- OpenStack Sahara Essentials
- Slick2D Game Development
- ServiceDesk Plus 8.x Essentials