Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d81be44

Browse files
Added __repr__ to ProbDist
1 parent e6100d4 commit d81be44

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

probability.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def show_approx(self, numfmt='%.3g'):
7979
return ', '.join([('%s: ' + numfmt) % (v, p)
8080
for (v, p) in sorted(self.prob.items())])
8181

82+
def __repr__(self):
83+
return "P(%s)" % self.varname
84+
8285

8386
class JointProbDist(ProbDist):
8487
"""A discrete probability distribute over a set of variables.

0 commit comments

Comments
 (0)