[Numpy-discussion] NaNs and infs

Alexander Schmolck a.schmolck at gmx.net
Sun Nov 9 09:54:24 CST 2003


Typically when NaNs/infs occur in my arrays something is going wrong, so
ideally I'd like an exception to be raised when that happens. Failing that I'd
like to have some robust (across python and Numeric/numarray versions) way of
testing wether an array contains NaNs or inifinities. I'd be happy as long as
this works on my particular platform (linux/intel).

At the moment I don't have much of a clue how to achieve this, which can be
pretty annoying (IIRC neither python nor Numeric is commited to any support of
NaN values; python comes with the optional fpectl module, which apparently is
however unmaintained, and generally deemed unsuitable for almost anything
-- not that I even manged to build it. Also NaN behavior doesn't seem
consistent across python scalars and Numeric arrays and different python
version (again IIRC)).

Any suggestions? How are other people dealing with these issues?

'as





More information about the Numpy-discussion mailing list