summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-11-13 23:45:45 -0800
committerEric Wieser <wieser.eric@gmail.com>2017-11-13 23:45:45 -0800
commitac6b1a902b99e340cf7eeeeb7392c91e38db9dd8 (patch)
tree589c9f85e52a75a16ed949c14bfa39777e651fc4 /numpy/core/arrayprint.py
parentbd80585cdae1d43fabb30ae0e184c2e40deb11e6 (diff)
downloadnumpy-ac6b1a902b99e340cf7eeeeb7392c91e38db9dd8.tar.gz
ENH: don't show boolean dtype, as it is implied
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index 8435574bf..55682f393 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -1129,7 +1129,7 @@ def _void_scalar_repr(x):
return StructureFormat.from_data(array(x), **_format_options)(x)
-_typelessdata = [int_, float_, complex_]
+_typelessdata = [int_, float_, complex_, bool_]
if issubclass(intc, int):
_typelessdata.append(intc)
if issubclass(longlong, int):
@@ -1162,6 +1162,8 @@ def dtype_is_implied(dtype):
array([1, 2, 3], dtype=np.int8)
"""
dtype = np.dtype(dtype)
+ if _format_options['legacy'] and dtype.type == bool_:
+ return False
return dtype.type in _typelessdata