changeset 77:5e6cd36a991c

added pretty print in empiricalDistribution
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 10 Feb 2011 22:41:38 -0500
parents 64fde2b1f96d
children 99e807c29753
files python/utils.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/python/utils.py	Thu Feb 10 22:15:54 2011 -0500
+++ b/python/utils.py	Thu Feb 10 22:41:38 2011 -0500
@@ -68,6 +68,15 @@
         
         return refCounts, refProba
 
+    def printReferenceCounts(self, refCounts=None):
+        if refCounts:
+            ref = refCounts
+        else:
+            ref = self.referenceCounts
+        for i in xrange(len(ref[0])):
+            print('{0}-{1} & {2:0.3} & {3:0.3} \\\\'.format(self.categories[i],self.categories[i+1],ref[1][i], ref[0][i]))
+
+
 #########################
 # maths section
 #########################