📜  python site-packages pyspark - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:49.200000             🧑  作者: Mango

代码示例1
import os

def myfun(x):`
        os.system("pip install shapely")
        return x
rdd = sc.parallelize([1,2,3,4]) ## assuming 4 worker nodes
rdd.map(lambda x: myfun(x)).collect() 
## call each cluster to run the code to import the library