combine#

ValueCounter.combine(current_accumulator: Dict[str, List], new_accumulator: Dict[str, List]) → Dict[str, List][source]#

Merge the value counts of two accumulators.

Counts for values in both accumulators are summed. Values only in new_accumulator are appended with their counts.

Parameters:
  • current_accumulator (Dict[str, List]) – The accumulated values and counts lists. This accumulator is updated in place.

  • new_accumulator (Dict[str, List]) – The values and counts lists to merge in.

Returns:

current_accumulator, updated with the counts from new_accumulator.

Return type:

Dict[str, List]