python site packages pyspark

Solutions on MaxInterview for python site packages pyspark by the best coders in the world

showing results for - "python site packages pyspark"
Carlos
11 Mar 2016
1import os
2
3def myfun(x):`
4        os.system("pip install shapely")
5        return x
6rdd = sc.parallelize([1,2,3,4]) ## assuming 4 worker nodes
7rdd.map(lambda x: myfun(x)).collect() 
8## call each cluster to run the code to import the library
9