diff options
Diffstat (limited to 'distribution.py')
| -rw-r--r-- | distribution.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/distribution.py b/distribution.py index d2503fa..47313b8 100644 --- a/distribution.py +++ b/distribution.py @@ -82,7 +82,7 @@ class Distribution: ax.bar(xax, yax) ax.set_ylabel(ylb) ax.set_xlabel(xlb) - ax.xaxis.set_major_locator(ticker.FixedLocator(xax)) + # ax.xaxis.set_major_locator(ticker.FixedLocator(xax)) # ax.yaxis.set_major_locator(ticker.FixedLocator(list(set(yax)))) plt.grid(True) plt.show() @@ -111,9 +111,15 @@ class Distribution: res.insert(operator(lv, rv, *args, **kwargs), lprob*rprob) return res + def __iadd__(self, other): + self = self.apply2(lambda x, y: x + y, other) + return self + def __add__(self, other): return self.apply2(lambda x, y: x + y, other) + __radd__ = __add__ + def __neg__(self): return self.apply(lambda x: -x) |
