Problems on Spark dealing with list of Python object
问题 I am learning Spark, and I just got a problem when I used Spark to deal with a list of Python object. The following is my code: import numpy as np from pyspark import SparkConf, SparkContext ### Definition of Class A class A: def __init__(self, n): self.num = n ### Function "display" def display(s): print s.num return s def main(): ### Initialize the Spark conf = SparkConf().setAppName("ruofan").setMaster("local") sc = SparkContext(conf = conf) ### Create a list of instances of Class A data =