summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/numeric.py4
-rw-r--r--numpy/lib/tests/test_ufunclike.py16
2 files changed, 10 insertions, 10 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index c56301a08..eb476eb3e 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -425,9 +425,9 @@ def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
typename=arr.dtype.name
lf = ''
if issubclass(arr.dtype.type, flexible):
- typename = str(arr.dtype)
+ typename = "'%s'" % str(arr.dtype)
lf = '\n'+' '*len("array(")
- return cName + "(%s, %sdtype='%s')" % (lst, lf, typename)
+ return cName + "(%s, %sdtype=%s)" % (lst, lf, typename)
def array_str(a, max_line_width=None, precision=None, suppress_small=None):
return array2string(a, max_line_width, precision, suppress_small, ' ', "", str)
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py
index fc7b27f2a..a28048342 100644
--- a/numpy/lib/tests/test_ufunclike.py
+++ b/numpy/lib/tests/test_ufunclike.py
@@ -18,26 +18,26 @@ array([[ 1., 1., 1., 1.],
Test isposinf, isneginf, sign
>>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0])
>>> U.isposinf(a)
-array([True, False, False, False, False, False], dtype='bool')
+array([True, False, False, False, False, False], dtype=bool)
>>> U.isneginf(a)
-array([False, True, False, False, False, False], dtype='bool')
+array([False, True, False, False, False, False], dtype=bool)
>>> nx.sign(a)
array([ 1., -1., 0., 0., 1., -1.])
Same thing with an output array:
>>> y = nx.zeros(a.shape, bool)
>>> U.isposinf(a, y)
-array([True, False, False, False, False, False], dtype='bool')
+array([True, False, False, False, False, False], dtype=bool)
>>> y
-array([True, False, False, False, False, False], dtype='bool')
+array([True, False, False, False, False, False], dtype=bool)
>>> U.isneginf(a, y)
-array([False, True, False, False, False, False], dtype='bool')
+array([False, True, False, False, False, False], dtype=bool)
>>> y
-array([False, True, False, False, False, False], dtype='bool')
+array([False, True, False, False, False, False], dtype=bool)
>>> nx.sign(a, y)
-array([True, True, False, False, True, True], dtype='bool')
+array([True, True, False, False, True, True], dtype=bool)
>>> y
-array([True, True, False, False, True, True], dtype='bool')
+array([True, True, False, False, True, True], dtype=bool)
Now log2:
>>> a = nx.array([4.5, 2.3, 6.5])