The Python Oracle

Why do "Not a Number" values equal True when cast as boolean in Python/Numpy?

This video explains
Why do "Not a Number" values equal True when cast as boolean in Python/Numpy?

--

Become part of the top 3% of the developers by applying to Toptal
https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Magic Ocean Looping

--

Chapters
00:00 Question
00:38 Accepted answer (Score 38)
01:06 Answer 2 (Score 8)
01:36 Answer 3 (Score 3)
02:15 Answer 4 (Score 2)
02:42 Thank you

--

Full question
https://stackoverflow.com/questions/1568...

Accepted answer links:
[documentation]: http://docs.python.org/2/library/stdtype...

Answer 2 links:
[truth-value testing]: http://docs.python.org/2/library/stdtype...
[numpy.isnan]: http://docs.scipy.org/doc/numpy/referenc...

Answer 4 links:
[python standard for truth testing]: http://docs.python.org/2/library/stdtype...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #math #numpy

#avk47