def calc_histogram_density()

in lib/analysis.py [0:0]


def calc_histogram_density(counts, n):
  density = []
  cdf = []
  cum = 0
  for i in range(len(counts)):
    density.append(float(counts[i]/n))
    cum = cum+counts[i]
    cdf.append(float(cum))
  cdf = [x / cum for x in cdf]
  return [density, cdf]