diff options
author | Mark Wiebe <mwiebe@enthought.com> | 2011-08-04 16:21:07 -0500 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:26:52 -0600 |
commit | 1992ee21cf1b87e9e5a48beff66ebc8fc8c381f0 (patch) | |
tree | bb4838dddf287300a97b3eeedaf321d807c699d7 /numpy/core/arrayprint.py | |
parent | 2bf8b668326bead664a91f8b33d51ff0629fef5a (diff) | |
download | numpy-1992ee21cf1b87e9e5a48beff66ebc8fc8c381f0.tar.gz |
ENH: missingdata: Another NA array formatting tweak
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: |