projects
/
sawsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa39f33
)
Ensure that self.headings exists in Histogram, e.g. in bell_rate.py's theory hist.
author
W. Trevor King
<wking@drexel.edu>
Sat, 6 Nov 2010 13:59:56 +0000
(06:59 -0700)
committer
W. Trevor King
<wking@drexel.edu>
Sat, 6 Nov 2010 13:59:56 +0000
(06:59 -0700)
pysawsim/histogram.py
patch
|
blob
|
history
diff --git
a/pysawsim/histogram.py
b/pysawsim/histogram.py
index c0d73b75c0fdd3a8810af5ceaf8fdcb8135d9e29..7591e56ef56c02dc693ead4a6f441457b96e054d 100644
(file)
--- a/
pysawsim/histogram.py
+++ b/
pysawsim/histogram.py
@@
-35,6
+35,9
@@
class Histogram (object):
>>> h = Histogram()
"""
+ def __init__(self):
+ self.headings = None
+
def calculate_bin_edges(self, data, bin_width):
"""
>>> h = Histogram()
@@
-60,7
+63,6
@@
class Histogram (object):
All bins should be of equal width (so we can calculate which
bin a data point belongs to).
"""
- self.headings = None
data = numpy.array(data)
self.bin_edges = numpy.array(bin_edges)
bin_width = self.bin_edges[1] - self.bin_edges[0]