From c05019eda16477f4be99f47755362c07e1acb5b8 Mon Sep 17 00:00:00 2001 From: Christian Brodbeck Date: Wed, 6 May 2015 10:49:41 -0400 Subject: BUG: setdiff1d return dtype Fixes #5846 (If called with an empty array as first argument, the returned array had dtype bool instead of the dtype of the input array) --- numpy/lib/tests/test_arraysetops.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/lib/tests/test_arraysetops.py') diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index 39196f4bc..852183ffe 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -5,7 +5,7 @@ from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( - run_module_suite, TestCase, assert_array_equal + run_module_suite, TestCase, assert_array_equal, assert_equal ) from numpy.lib.arraysetops import ( ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, in1d @@ -286,6 +286,8 @@ class TestSetOps(TestCase): assert_array_equal(c, ec) assert_array_equal([], setdiff1d([], [])) + a = np.array((), np.uint32) + assert_equal(setdiff1d(a, []).dtype, np.uint32) def test_setdiff1d_char_array(self): a = np.array(['a', 'b', 'c']) -- cgit v1.2.1