summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-08-16 21:01:34 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-08-27 07:26:55 -0600
commitf597374edc298810083799e8539c99fc0a93b319 (patch)
tree6d6966dd55b4e9ab22079453b4a424a0d9544fc0 /numpy/core/numeric.py
parent965e4cff5c4c50e8ff051a3363adc6cf6aa640cd (diff)
downloadnumpy-f597374edc298810083799e8539c99fc0a93b319.tar.gz
ENH: missingdata: Change default to create NA-mask when NAs are in lists
Also adjust the repr to drop maskna=True when this rule will enable it automatically.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index f1e6b2da9..9b7c20d76 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1336,9 +1336,12 @@ def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
skipdtype = (arr.dtype.type in _typelessdata) and arr.size > 0
if arr.flags.maskna:
- lst += ", maskna=True"
- # If everything is NA, can't skip the type
- if skipdtype and all(isna(arr)):
+ whichna = isna(arr)
+ # If nothing is NA, explicitly signal the NA-mask
+ if not any(whichna):
+ lst += ", maskna=True"
+ # If everything is NA, can't skip the dtype
+ if skipdtype and all(whichna):
skipdtype = False
if skipdtype: