summaryrefslogtreecommitdiff
path: root/doc/neps
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 /doc/neps
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 'doc/neps')
-rw-r--r--doc/neps/missing-data.rst36
1 files changed, 29 insertions, 7 deletions
diff --git a/doc/neps/missing-data.rst b/doc/neps/missing-data.rst
index 49528da41..3cebf25ec 100644
--- a/doc/neps/missing-data.rst
+++ b/doc/neps/missing-data.rst
@@ -347,20 +347,42 @@ instead of masked and unmasked values. The functions are
'np.isna' and 'np.isavail', which test for NA or available values
respectively.
-Creating Masked Arrays
-======================
+Creating NA-Masked Arrays
+=========================
+
+The usual way to create an array with an NA mask is to pass the keyword
+parameter maskna=True to one of the constructors. Most functions that
+create a new array take this parameter, and produce an NA-masked
+array with all its elements exposed when the parameter is set to True.
-There are two flags which indicate and control the nature of the mask
-used in masked arrays.
+There are also two flags which indicate and control the nature of the mask
+used in masked arrays. These flags can be used to add a mask, or ensure
+the mask isn't a view into another array's mask.
-First is 'arr.flags.hasmaskna', which is True for all masked arrays and
+First is 'arr.flags.maskna', which is True for all masked arrays and
may be set to True to add a mask to an array which does not have one.
Second is 'arr.flags.ownmaskna', which is True if the array owns the
memory to the mask, and False if the array has no mask, or has a view
-into the mask of another array. If this is set to False in a masked
+into the mask of another array. If this is set to True in a masked
array, the array will create a copy of the mask so that further modifications
-to the mask will not affect the array being viewed.
+to the mask will not affect the original mask from which the view was taken.
+
+NA-Masks When Constructing From Lists
+=====================================
+
+The initial design of NA-mask construction was to make all construction
+fully explicit. This turns out to be unwieldy when working interactively
+with NA-masked arrays, and having an object array be created instead of
+an NA-masked array can be very surprising.
+
+Because of this, the design has been changed to enable an NA-mask whenever
+creating an array from lists which have an NA object in them. There could
+be some debate of whether one should create NA-masks or NA-bitpatterns
+by default, but due to the time constraints it was only feasible to tackle
+NA-masks, and extending the NA-mask support more fully throughout NumPy seems
+much more reasonable than starting another system and ending up with two
+incomplete systems.
Mask Implementation Details
===========================