Skip to content

Instantly share code, notes, and snippets.

View vivek-bombatkar's full-sized avatar
👍
Learning...

Vivek Bombatkar vivek-bombatkar

👍
Learning...
View GitHub Profile
@astrojuanlu
astrojuanlu / reducebykey.py
Created December 28, 2015 19:04
Python implementation of Spark reduceByKey()
from functools import reduce
from itertools import groupby
def reduceByKey(func, iterable):
"""Reduce by key.
Equivalent to the Spark counterpart
Inspired by http://stackoverflow.com/q/33648581/554319