Skip to content

Instantly share code, notes, and snippets.

@stangirala
Created September 19, 2016 02:36
Show Gist options
  • Save stangirala/93a8c17ed18c10e11dd5b4d6a89c24c5 to your computer and use it in GitHub Desktop.
Save stangirala/93a8c17ed18c10e11dd5b4d6a89c24c5 to your computer and use it in GitHub Desktop.

Revisions

  1. stangirala created this gist Sep 19, 2016.
    10 changes: 10 additions & 0 deletions good_combiner.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    def map(intValue):
    store = {}
    store[computeBin(intValue)] += 1
    print _, store

    def reduce(_, *stores):
    _store = {}
    for store in stores:
    for k, v in store:
    _store[k] += v