human
I am working on the file "Big-Data-and-Spark/.ipynb_checkpoints/lecture_notes-checkpoint.ipynb".
The first task is:
Notes

sc.parallelize creates an RDD.

map and filter are transformations.

They create new RDDs from existing RDDs.

count is an action and brings the data from the RDDs back to the
  driver.

Spark Terminology
Term                   |Meaning
----                   |-------
RDD                    |Resilient Distributed Dataset or a distributed sequence of records
Spark Job              |Sequence of transformations on data with a final action
Spark Application      |Sequence of Spark jobs and other code
Transformation         |Spark operation that produces an RDD
Action                 |Spark operation that produces a local object

A Spark job consists of a series of transformations followed by an
  action.

It pushes the data to the cluster, all computation happens on the
  executors, then the result is sent back to the driver.

Pop Quiz
<details><summary>
In this Spark job what is the transformation is what is the action? 
`sc.parallelize(xrange(10)).filter(lambda x: x % 2 == 0).collect()`
</summary>
1. `filter` is the transformation.
<br>
2. `collect` is the action.
</details>

Lambda vs Functions

Instead of lambda you can pass in fully defined functions into
  map, filter, and other RDD transformations.

Use lambda for short functions. 

Use def for more substantial functions.

Finding Primes
Q: Find all the primes less than 100.

Define function to determine if a number is prime.
Can you write Python code for it?

=====
What is a Python code to find all the primes less than 100?
assistant
#Here is Python code to find all the primes less than 100.

def is_prime(number):
    factor_min = 2
    factor_max = int(number**0.5)+1
    for factor in xrange(factor_min,factor_max):
        if number % factor == 0:
            return False
    return True