def mean(self, histogram, bins):
    mean_upper = 0
    mean_lower = 0
    for i, binval in enumerate(histogram):
      mean_upper += binval*( (bins[i+1] + bins[i]) / 2 )
      mean_lower += binval 

    mean = mean_upper / mean_lower
    return mean
Given a histogram and the bin widths, calculate the mean for the histogram
dataset/ETHPy150Open neurodata/ndstore/scripts/imghist16.py/ImgHist.mean