From 9ae84854d9c48a751e57c5cd0e9636678a6d2359 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Tue, 24 Jan 2017 16:07:52 +0100 Subject: BUG: fix mean for float 16 non-array inputs --- numpy/core/_methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/_methods.py') diff --git a/numpy/core/_methods.py b/numpy/core/_methods.py index abfd0a3cc..c05316d18 100644 --- a/numpy/core/_methods.py +++ b/numpy/core/_methods.py @@ -72,10 +72,10 @@ def _mean(a, axis=None, dtype=None, out=None, keepdims=False): ret = um.true_divide( ret, rcount, out=ret, casting='unsafe', subok=False) if is_float16_result and out is None: - ret = a.dtype.type(ret) + ret = arr.dtype.type(ret) elif hasattr(ret, 'dtype'): if is_float16_result: - ret = a.dtype.type(ret / rcount) + ret = arr.dtype.type(ret / rcount) else: ret = ret.dtype.type(ret / rcount) else: -- cgit v1.2.1