楼主: Lisrelchen
3138 18

【Github】Frank Kane's Taming Big Data with Apache Spark and Python [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6906
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2017-8-13 05:15:36 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Frank Kane's Taming Big Data with Apache Spark and Python


本帖隐藏的内容

https://github.com/PacktPublishing/Frank-Kanes-Taming-Big-Data-with-Apache-Spark-and-Python


This is the code repository for Frank Kane's Taming Big Data with Apache Spark and Python, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

Frank Kane’s Taming Big Data with Apache Spark and Python is your companion to learning Apache Spark in a hands-on manner. Frank will start you off by teaching you how to set up Spark on a single system or on a cluster, and you’ll soon move on to analyzing large data sets using Spark RDD, and developing and running effective Spark jobs quickly using Python.

Apache Spark has emerged as the next big thing in the Big Data domain – quickly rising from an ascending technology to an established superstar in just a matter of years. Spark allows you to quickly extract actionable insights from large amounts of data, on a real-time basis, making it an essential tool in many modern businesses.

Frank has packed this book with over 15 interactive, fun-filled examples relevant to the real world, and he will empower you to understand the Spark ecosystem and implement production-grade real-time Spark projects with ease. ##Instructions and Navigation All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

The code will look like the following:

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))

For this book you’ll need a Python development environment (Python 3.5 or newer), a Canopy installer, Java Development Kit, and of course Spark itself (Spark 2.0 and beyond).

We'll show you how to install this software in first chapter of the book.

This book is based on the Windows operating system, so installations are provided according to it. If you have Mac or Linux, you can follow this URL http://media.sundog-soft.com/spark-python-install.pdf, which contains written instructions on getting everything set up on Mac OS and on Linux.

Related ProductsSuggestions and Feedback

Click here if you have any feedback or suggestions.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Apache Spark Big data python apache GitHub

已有 1 人评分经验 收起 理由
kongqingbao280 + 20 精彩帖子

总评分: 经验 + 20   查看全部评分

本帖被以下文库推荐

沙发
Lisrelchen 发表于 2017-8-13 05:16:10
  1. from pyspark.sql import SparkSession
  2. from pyspark.sql import Row

  3. import collections

  4. # Create a SparkSession (Note, the config section is only for Windows!)
  5. spark = SparkSession.builder.config("spark.sql.warehouse.dir", "file:///C:/temp").appName("SparkSQL").getOrCreate()

  6. def mapper(line):
  7.     fields = line.split(',')
  8.     return Row(ID=int(fields[0]), name=str(fields[1].encode("utf-8")), age=int(fields[2]), numFriends=int(fields[3]))

  9. lines = spark.sparkContext.textFile("fakefriends.csv")
  10. people = lines.map(mapper)

  11. # Infer the schema, and register the DataFrame as a table.
  12. schemaPeople = spark.createDataFrame(people).cache()
  13. schemaPeople.createOrReplaceTempView("people")

  14. # SQL can be run over DataFrames that have been registered as a table.
  15. teenagers = spark.sql("SELECT * FROM people WHERE age >= 13 AND age <= 19")

  16. # The results of SQL queries are RDDs and support all the normal RDD operations.
  17. for teen in teenagers.collect():
  18.   print(teen)

  19. # We can also use functions instead of SQL queries:
  20. schemaPeople.groupBy("age").count().orderBy("age").show()

  21. spark.stop()
复制代码

藤椅
Lisrelchen 发表于 2017-8-13 05:17:14
  1. from pyspark import SparkConf, SparkContext

  2. conf = SparkConf().setMaster("local").setAppName("PopularMovies")
  3. sc = SparkContext(conf = conf)

  4. lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
  5. movies = lines.map(lambda x: (int(x.split()[1]), 1))
  6. movieCounts = movies.reduceByKey(lambda x, y: x + y)

  7. flipped = movieCounts.map( lambda (x, y) : (y, x) )
  8. sortedMovies = flipped.sortByKey()

  9. results = sortedMovies.collect()

  10. for result in results:
  11.     print(result)
复制代码

板凳
hjtoh 发表于 2017-8-13 06:09:59 来自手机
Lisrelchen 发表于 2017-8-13 05:15
Frank Kane's Taming Big Data with Apache Spark and Python
**** 本内容被作者隐藏 ****
This is the c ...
谢谢分享

报纸
军旗飞扬 在职认证  发表于 2017-8-13 06:35:03
谢谢楼主分享!

地板
MouJack007 发表于 2017-8-13 07:32:47
谢谢楼主分享!

7
MouJack007 发表于 2017-8-13 07:33:40

8
albertwishedu 发表于 2017-8-13 08:52:09

9
franky_sas 发表于 2017-8-13 13:00:52

10
Rusty.Liao 发表于 2017-8-14 23:16:02
为什么都要回复才能下载呢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-16 22:56