From da19f3edc5c8995afc821ddc949b386e781e0b6a Mon Sep 17 00:00:00 2001 From: dhuard Date: Wed, 12 Aug 2009 14:12:21 +0000 Subject: Fixed compatibility issue of histogram with matplotlib 0.91.2 --- numpy/lib/function_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/function_base.py') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index d56e69611..663c3d2ef 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -378,11 +378,11 @@ def histogram(a, bins=10, range=None, normed=False, weights=None, new=None): n = np.diff(n) - if normed is False: - return n, bins - elif normed is True: + if normed: db = array(np.diff(bins), float) return n/(n*db).sum(), bins + else: + return n, bins def histogramdd(sample, bins=10, range=None, normed=False, weights=None): -- cgit v1.2.1