summaryrefslogtreecommitdiff
path: root/numpy/lib/arraysetops.py
diff options
context:
space:
mode:
authorAllan Haldane <ealloc@gmail.com>2017-11-18 19:39:29 +0100
committerGitHub <noreply@github.com>2017-11-18 19:39:29 +0100
commit365fc9d19b52325bd5618aac1a3fa7b8a6be3b3c (patch)
treefba9b1e900840c057cea1f7bdc872c477e0aa60c /numpy/lib/arraysetops.py
parent2d140f11857fc1353d6b2dcbb801e693128fd09a (diff)
parentac6b1a902b99e340cf7eeeeb7392c91e38db9dd8 (diff)
downloadnumpy-365fc9d19b52325bd5618aac1a3fa7b8a6be3b3c.tar.gz
Merge pull request #10021 from eric-wieser/no-dtype-bool-repr
ENH: Don't show the boolean dtype in array_repr
Diffstat (limited to 'numpy/lib/arraysetops.py')
-rw-r--r--numpy/lib/arraysetops.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index f3301af92..a9426cdf3 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -435,12 +435,12 @@ def in1d(ar1, ar2, assume_unique=False, invert=False):
>>> states = [0, 2]
>>> mask = np.in1d(test, states)
>>> mask
- array([ True, False, True, False, True], dtype=bool)
+ array([ True, False, True, False, True])
>>> test[mask]
array([0, 2, 0])
>>> mask = np.in1d(test, states, invert=True)
>>> mask
- array([False, True, False, True, False], dtype=bool)
+ array([False, True, False, True, False])
>>> test[mask]
array([1, 5])
"""
@@ -552,13 +552,13 @@ def isin(element, test_elements, assume_unique=False, invert=False):
>>> mask = np.isin(element, test_elements)
>>> mask
array([[ False, True],
- [ True, False]], dtype=bool)
+ [ True, False]])
>>> element[mask]
array([2, 4])
>>> mask = np.isin(element, test_elements, invert=True)
>>> mask
array([[ True, False],
- [ False, True]], dtype=bool)
+ [ False, True]])
>>> element[mask]
array([0, 6])
@@ -568,13 +568,13 @@ def isin(element, test_elements, assume_unique=False, invert=False):
>>> test_set = {1, 2, 4, 8}
>>> np.isin(element, test_set)
array([[ False, False],
- [ False, False]], dtype=bool)
+ [ False, False]])
Casting the set to a list gives the expected result:
>>> np.isin(element, list(test_set))
array([[ False, True],
- [ True, False]], dtype=bool)
+ [ True, False]])
"""
element = np.asarray(element)
return in1d(element, test_elements, assume_unique=assume_unique,