Mercurial > hg > numerics
comparison numerics/histogram.py @ 72:06094870fdd7
more stubbing
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 28 Feb 2015 17:05:04 -0800 |
parents | 9a2674b32754 |
children | 8e93d7357c6b |
comparison
equal
deleted
inserted
replaced
71:9a2674b32754 | 72:06094870fdd7 |
---|---|
39 bins[1:])) | 39 bins[1:])) |
40 | 40 |
41 def add(self, *values): | 41 def add(self, *values): |
42 """add values to the histogram""" | 42 """add values to the histogram""" |
43 for value in values: | 43 for value in values: |
44 raise NotImplementedError('TODO') # -> record TODO items | 44 for vmin, vmax in self.data.keys(): |
45 if vmin <= value <= vmax: | |
46 self.data[(vmin, vmax)].append(value) | |
45 | 47 |
46 def __iadd__(self, value): | 48 def __iadd__(self, value): |
47 self.add(value) | 49 self.add(value) |
48 return self | 50 return self |
49 | 51 |