pip install dpark dpark <your_program.py> python from dpark import DparkContext def square(x): return x**2 if __name__ == "__main__": dpark_context = DparkContext() data = [1, 2, 3, 4, 5] rdd = dpark_context.makeRDD(data) result = rdd.map(square).reduce(lambda a, b: a + b) print("The sum of squares is:", result)


上一篇:
下一篇:
切换中文