map-reduce for efficient histograms in python