8000 Missingdata - Reorganize nditer implementation into a few files by mwiebe · Pull Request #104 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Missingdata - Reorganize nditer implementation into a few files #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
NEP: missingdata: Add more C API details
  • Loading branch information
Mark Wiebe committed Jul 7, 2011
commit 4c157ece1e8a2079fb2c49c3cd4d3f3549ccdeb1
28 changes: 27 additions & 1 deletion doc/neps/missing-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,22 @@ There are 2 (or 3) flags which must be added to the array flags::
/* To possibly add in a later revision */
NPY_ARRAY_HARDNAMASK

To allow the easy detection of NA support, and whether an array
has any missing values, we add the following functions:

PyDataType_HasNASupport(PyArray_Descr* dtype)
Returns true if this is an NA dtype, or a struct
dtype where every field has NA support.

PyArray_HasNASupport(PyArrayObject* obj)
Returns true if the array dtype has NA support, or
the array has an NA mask.

PyArray_ContainsNA(PyArrayObject* obj)
Returns false if the array has no NA support. Returns
true if the array has NA support AND there is an
NA anywhere in the array.

********************************************
C Iterator API Changes: Iteration With Masks
********************************************
Expand Down Expand Up @@ -737,10 +753,20 @@ Iterator NA-array Features
==========================

NPY_ITER_USE_NAMASK
If the operand has an NA dtype, a mask, or both, this adds a new
If the operand has an NA dtype, an NA mask, or both, this adds a new
virtual operand to the end of the operand list which iterates
over the mask of the particular operand.

NPY_ITER_IGNORE_NAMASK
If an operand has an NA mask, by default the iterator will raise
an exception unless USE_NAMASK is specified. This flag disables that
check, and is intended for cases where one has first checked that
all the elements in the array are not NA using the
PyArray_ContainsNA function.

If the dtype is an NA dtype, this also strips the NA-ness from
the dtype, showing a dtype that does not support NA.

********************
Rejected Alternative
********************
Expand Down
0