diff options
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r-- | numpy/core/arrayprint.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index 0658968bf..1d072fe5d 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -212,8 +212,12 @@ def _leading_trailing(a): return b def _boolFormatter(x): - if x: return ' True' - else: return 'False' + if isna(x): + return str(x) + elif x: + return ' True' + else: + return 'False' def repr_format(x): @@ -646,6 +650,9 @@ class IntegerFormat(object): # if reduce(data) fails, this instance will not be called, just # instantiated in formatdict. pass + except ValueError: + # this occurs when everything is NA + pass def __call__(self, x): if not isna(x) and _MININT < x < _MAXINT: |