From 1992ee21cf1b87e9e5a48beff66ebc8fc8c381f0 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Thu, 4 Aug 2011 16:21:07 -0500 Subject: ENH: missingdata: Another NA array formatting tweak --- numpy/core/arrayprint.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'numpy/core/arrayprint.py') 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: -- cgit v1.2.1