From: Keith G. <kwg...@gm...> - 2006-11-11 23:04:31
|
x.min() and x.max() depend on the ordering of the elements: >> x = M.matrix([[ M.nan, 2.0, 1.0]]) >> x.min() nan >> x = M.matrix([[ 1.0, 2.0, M.nan]]) >> x.min() 1.0 If I were to try the latter in ipython, I'd assume, great, min() ignores NaNs. But then the former would be a bug in my program. Is this related to how sort works? >> x = M.matrix([[ M.nan, 2.0, 1.0]]) >> x.sort() >> x matrix([[ nan, 1. , 2. ]]) >> x = M.matrix([[ 1.0, 2.0, M.nan]]) >> x.sort() >> x matrix([[ 1. , 2. , nan]]) |