column_accumulator

class coffea.processor.column_accumulator(value)[source]

Bases: AccumulatorABC

An appendable numpy ndarray

Parameters:

value (numpy.ndarray) – The identity value array, which should be an empty ndarray with the desired row shape. The column dimension will correspond to the first index of value shape.

Examples

If a set of accumulators is defined as:

a = column_accumulator(np.array([]))
b = column_accumulator(np.array([1., 2., 3.]))
c = column_accumulator(np.array([4., 5., 6.]))

then:

>>> a + b
column_accumulator(array([1., 2., 3.]))
>>> c + b + a
column_accumulator(array([4., 5., 6., 1., 2., 3.]))

Attributes Summary

value

The current value of the column

Methods Summary

add(other)

Add another accumulator to this one in-place

identity()

Identity of the accumulator

Attributes Documentation

value

The current value of the column

Returns a numpy array where the first dimension is the column dimension

Methods Documentation

add(other)[source]

Add another accumulator to this one in-place

identity()[source]

Identity of the accumulator

A value such that any other value added to it will return the other value