[PYTHON MATRIX-SIG] Handling null data points
Jim Fulton
jim.fulton@digicool.com
Wed, 08 Jan 1997 13:46:17 -0500
Konrad Hinsen wrote:
>
> > NaN sounds interesting - at the moment I just use 1e20. This works fine
> > for me as I only have to handle vectors of floats but it would be nice
> > to have a solution that would be applicable to other data types.
>
> NaN is part of the IEEE float format specification, so it wouldn't be
> available for anything but floats. There's also infinity (positive
> and negative) as a special value. But it is somewhat risky to use
> them as "no data" identifiers because some functions return them
> as error indicators (e.g. sqrt(-1) is NaN). You would never know
> whether a certain data item is unknown or the result of an undefined
> operation.
In some systems I've worked with that supported missing values,
calling a function with a value outside its range yielded a
missing result. So I think the example you give is reasonable. :-)
This is a debatable point though.
--
Jim Fulton Digital Creations
jim@digicool.com 540.371.6909
## Python is my favorite language ##
## http://www.python.org/ ##
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================