Пример #1
0
 def std(self):
     """Standard deviation of binned data"""
     vals = array(sortedDictValues(self.bins))
     a = self.midpoints*vals
     sum_bin_vals = sum(self.bins.values())
     mean_val = sum(a) / sum_bin_vals
     return sqrt(sum(((self.midpoints-mean_val)*vals)**2) / sum_bin_vals)
Пример #2
0
 def mean(self):
     """Mean of binned data"""
     a = self.midpoints*array(sortedDictValues(self.bins))
     return sum(a) / sum(self.bins.values())
Пример #3
0
 def values(self):
     return sortedDictValues(self.bins)