pyspark.SparkContext.accumulator¶
- 
SparkContext.accumulator(value: T, accum_param: Optional[AccumulatorParam[T]] = None) → Accumulator[T]¶ Create an
Accumulatorwith the given initial value, using a givenAccumulatorParamhelper object to define how to add values of the data type if provided. Default AccumulatorParams are used for integers and floating-point numbers if you do not provide one. For other types, a custom AccumulatorParam can be used.