The Python Oracle

In Python 3.6, why does a negative number to the power of a fraction return nan when in a numpy array?

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: Thinking It Over

--

Chapters
00:00 Question
01:50 Accepted answer (Score 10)
03:29 Answer 2 (Score 0)
03:53 Thank you

--

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

Question links:
[NumPy official quickstart guide]: https://docs.scipy.org/doc/numpy-dev/use...
[NumPy, RuntimeWarning: invalid value encountered in power
]: https://stackoverflow.com/questions/4538...

Accepted answer links:
[documentation]: https://docs.scipy.org/doc/numpy/referen...

--

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

--

Tags
#python #numpy

#avk47