summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/arrayprint.py2
-rw-r--r--numpy/core/tests/test_maskna.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index 7e40e9386..ccfca78ec 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -610,7 +610,7 @@ class FloatFormat(object):
err = _nc.seterr(invalid='ignore')
try:
if isna(x):
- return str(x).replace('NA', _na_str, 1)
+ return self.special_fmt % (str(x).replace('NA', _na_str, 1),)
elif isnan(x):
if self.sign:
return self.special_fmt % ('+' + _nan_str,)
diff --git a/numpy/core/tests/test_maskna.py b/numpy/core/tests/test_maskna.py
index 35165cc24..8a644c080 100644
--- a/numpy/core/tests/test_maskna.py
+++ b/numpy/core/tests/test_maskna.py
@@ -92,9 +92,9 @@ def test_array_maskna_repr():
a = np.array([np.NA, 3], maskna=True)
assert_equal(repr(a), 'array([NA, 3])')
a = np.array([np.NA, np.NA])
- assert_equal(repr(a), 'array([NA, NA], dtype=float64)')
+ assert_equal(repr(a), 'array([ NA, NA], dtype=float64)')
a = np.array([3.5, np.NA], maskna=True)
- assert_equal(repr(a), 'array([ 3.5, NA])')
+ assert_equal(repr(a), 'array([ 3.5, NA])')
a = np.array([3.75, 6.25], maskna=True)
assert_equal(repr(a), 'array([ 3.75, 6.25], maskna=True)')
a = np.array([3.75, 6.25], maskna=True, dtype='f4')