# 2\. Why Spark with Python ?

Chinese proverb

**Sharpening the knife longer can make it easier to hack the firewood** – old Chinese proverb

I want to answer this question from the following two parts:

## 2.1\. Why Spark?

I think the following four main reasons from [Apache Spark™](http://spark.apache.org/) official website are good enough to convince you to use Spark.

1.  Speed

    Run programs up to 100x faster than Hadoop MapReduce in memory, or 10x faster on disk.

    Apache Spark has an advanced DAG execution engine that supports acyclic data flow and in-memory computing.

> ![https://runawayhorse001.github.io/LearningApacheSpark/_images/logistic-regression.png](img/72748fa31cb48a5062a2fc7949bd0b45.jpg)
> 
> Logistic regression in Hadoop and Spark

1.  Ease of Use

    Write applications quickly in Java, Scala, Python, R.

    Spark offers over 80 high-level operators that make it easy to build parallel apps. And you can use it interactively from the Scala, Python and R shells.

2.  Generality

    Combine SQL, streaming, and complex analytics.

    Spark powers a stack of libraries including SQL and DataFrames, MLlib for machine learning, GraphX, and Spark Streaming. You can combine these libraries seamlessly in the same application.

> [![https://runawayhorse001.github.io/LearningApacheSpark/_images/stack.png](img/d3b112475692c0421480c01cd029cf09.jpg)](https://runawayhorse001.github.io/LearningApacheSpark/_images/stack.png)
> 
> The Spark stack

1.  Runs Everywhere

    Spark runs on Hadoop, Mesos, standalone, or in the cloud. It can access diverse data sources including HDFS, Cassandra, HBase, and S3.

> [![https://runawayhorse001.github.io/LearningApacheSpark/_images/spark-runs-everywhere.png](img/b9eb842264e6a48a42ecf5f142e32414.jpg)](https://runawayhorse001.github.io/LearningApacheSpark/_images/spark-runs-everywhere.png)
> 
> The Spark platform

## 2.2\. Why Spark with Python (PySpark)?

No matter you like it or not, Python has been one of the most popular programming languages.

> ![https://runawayhorse001.github.io/LearningApacheSpark/_images/languages.jpg](img/348c0d7bc8db0d630042e5faffd2d647.jpg)
> 
> KDnuggets Analytics/Data Science 2017 Software Poll from [kdnuggets](http://www.kdnuggets.com/2017/05/poll-analytics-data-science-machine-learning-software-leaders.html).