# HG changeset patch # User Nicolas Saunier # Date 1297395698 18000 # Node ID 5e6cd36a991c5a672521241c0ebeb6abe9c7fabc # Parent 64fde2b1f96d4bfedc8db62e9fe4ccab1617b96e added pretty print in empiricalDistribution diff -r 64fde2b1f96d -r 5e6cd36a991c python/utils.py --- 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 #########################