[SciPy-User] finding max value in a vector which contains NaN's

Pierre GM pgmdevlist at gmail.com
Wed May 12 00:24:35 EDT 2010


On May 11, 2010, at 11:47 PM, Oz Nahum wrote:
> Hi All,
> I have a code that needs to find a max value in a vector, which has also NaN.
> using max(cr), I get answer: nan, even though, the largest value is 15.1879....
> 
> Anyone has an idea how to avoid this problem ? I don't want to make a
> loop to kick out all the NaN values, although that would be a
> solution...


Use `nanmax` (a numpy function).





More information about the SciPy-User mailing list