Using the Python CAPI, you can get the MA module object, then from it =
the
function isMaskedArray(a), which you then can call with your argument a. =
You
can do the first two steps just once since they won't change.
-----Original Message-----
From: num...@li...
[mailto:num...@li...] On Behalf Of
Kuzminski, Stefan R
Sent: Monday, March 17, 2003 11:20 AM
To: num...@li...
Subject: [Numpy-discussion] Masked arrays in C extensions
Hi,=20
I'm writing a C exenstion which uses Masked Arrays. Since a MA isn't a
'PyArray_Type', the PyArray_Check macro returns false, regular arrays =
work
fine. ( from a SWIG typemap here )
if (!PyArray_Check($input)) {=20
PyErr_SetString(PyExc_TypeError,"$1 is not a Numeric Array");=20
return NULL;=20
}=20
My question is how do I deal with Masked Arrays differently than regular
Array in the C code? Any sample code would be greatly appreciated!
thanks,=20
Stefan Kuzminski=20
P.S. this is Python2.2, Numeric-22=20
------------------------------------------------------- This SF.net =
email is
sponsored by:Crypto Challenge is now open! Get cracking and register =
here
for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________ Numpy-discussion mailing
list Num...@li...
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
|