Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Big Data Analysis with Python

You're reading from  Big Data Analysis with Python

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789955286
Pages 276 pages
Edition 1st Edition
Languages
Authors (3):
Ivan Marin Ivan Marin
Profile icon Ivan Marin
Ankit Shukla Ankit Shukla
Profile icon Ankit Shukla
Sarang VK Sarang VK
Profile icon Sarang VK
View More author details

Table of Contents (11) Chapters

Big Data Analysis with Python
Preface
1. The Python Data Science Stack 2. Statistical Visualizations 3. Working with Big Data Frameworks 4. Diving Deeper with Spark 5. Handling Missing Values and Correlation Analysis 6. Exploratory Data Analysis 7. Reproducibility in Big Data Analysis 8. Creating a Full Analysis Report Appendix

Getting Started with Spark DataFrames


To get started with Spark DataFrames, we will have to create something called a SparkContext first. SparkContext configures the internal services under the hood and facilitates command execution from the Spark execution environment.

Note

We will be using Spark version 2.1.1, running on Python 3.7.1. Spark and Python are installed on a MacBook Pro, running macOS Mojave version 10.14.3, with a 2.7 GHz Intel Core i5 processor and 8 GB 1867 MHz DDR3 RAM.

The following code snippet is used to create SparkContext:

from pyspark import SparkContext
sc = SparkContext()

Note

In case you are working in the PySpark shell, you should skip this step, as the shell automatically creates the sc (SparkContext) variable when it is started. However, be sure to create the sc variable while creating a PySpark script or working with Jupyter Notebook, or your code will throw an error.

We also need to create an SQLContext before we can start working with DataFrames. SQLContext in Spark...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}