Package pyspark :: Module accumulators :: Class AddingAccumulatorParam
[frames] | no frames]

Class AddingAccumulatorParam

source code

      object --+    
               |    
AccumulatorParam --+
                   |
                  AddingAccumulatorParam

An AccumulatorParam that uses the + operators to add values. Designed for simple types such as integers, floats, and lists. Requires the zero value for the underlying type as a parameter.

Instance Methods
 
__init__(self, zero_value)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
zero(self, value)
Provide a "zero value" for the type, compatible in dimensions with the provided value (e.g., a zero vector)
source code
 
addInPlace(self, value1, value2)
Add two values of the accumulator's data type, returning a new value; for efficiency, can also update value1 in place and return it.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, zero_value)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

zero(self, value)

source code 

Provide a "zero value" for the type, compatible in dimensions with the provided value (e.g., a zero vector)

Overrides: AccumulatorParam.zero
(inherited documentation)

addInPlace(self, value1, value2)

source code 

Add two values of the accumulator's data type, returning a new value; for efficiency, can also update value1 in place and return it.

Overrides: AccumulatorParam.addInPlace
(inherited documentation)