def hist_bins(bins, vals):
 hist = zeros(len(bins))
 j = 0
 for i in vals:
  while (bins[j] < i):
   j += 1
  hist[j] += 1
 return (asarray(bins), hist)

def hist_bins ( bins , vals ) : hist = zeros ( len ( bins ) ) j = 0 for i in vals : while ( bins [ j ] < i ) : j += 1 hist [ j ] += 1 return ( asarray ( bins ) , hist )
creates a histogram given the bins and the vals .