- Frank Kane's Taming Big Data with Apache Spark and Python
- Frank Kane
- 280字
- 2021-07-02 21:12:14
Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, path names, dummy URLs, user input, and Twitter handles are shown as follows: "Now, you'll need to remember the path that we installed the JDK into, which in our case was C:\jdk." A block of code is set as follows:
from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collections.OrderedDict(sorted(result.items()))
for key, value in sortedResults.items():
print("%s %i" % (key, value))
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collections.OrderedDict(sorted(result.items()))
for key, value in sortedResults.items():
print("%s %i" % (key, value))
Any command-line input or output is written as follows:
spark-submit ratings-counter.py
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Now, if you're on Windows, I want you to right-click on the Enthought Canopy icon, go to Properties and then to Compatibility (this is on Windows 10), and make sure Run this program as an administrator is checked"
- Java范例大全
- Debian 7:System Administration Best Practices
- Java 9 Programming Blueprints
- Mastering AndEngine Game Development
- PLC編程及應(yīng)用實(shí)戰(zhàn)
- PhpStorm Cookbook
- VMware虛擬化技術(shù)
- Java高并發(fā)核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- Java EE Web應(yīng)用開發(fā)基礎(chǔ)
- 從零學(xué)Java設(shè)計(jì)模式
- Python Machine Learning Cookbook
- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- JavaScript高級(jí)程序設(shè)計(jì)(第4版)
- Eclipse開發(fā)(學(xué)習(xí)筆記)
- Mastering VMware vSphere Storage