Not to go off on too much of a tangent, but isn't NaN unorderable? Its greater than nothing, and less than nothing, so you can't even really sort a list with a NaN value in it (..though I'm sure python does sort it by some metric for practical reasons) - it would be impossible to find a NaN with a binary search... it would be impossible to have a NaN in an ordered sequence .... wouldn't it?
-----Original Message----- From: Cameron Simpson <[email protected]> Sent: Sunday, August 29, 2021 5:36 PM To: [email protected] Subject: [Python-ideas] Re: NAN handling in statistics functions On 27Aug2021 15:50, Finn Mason <[email protected]> wrote: >Perhaps a math.hasnan() function for collections could be implemented >with binary search? > >math.hasnan(seq) Why would a binary search be of use? A staraight sequential scan of the sequence seems the only reliable method. Binary search is for finding a value in an ordered sequence. Cheers, Cameron Simpson <[email protected]> _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/22IYUU JRCPCYUIZBXAUHWE6SBPTIHQME/ Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/M6IROKWARQTCVI7TT3WZUD6TN7H3IRNH/ Code of Conduct: http://python.org/psf/codeofconduct/
