I'm getting an error <string>:149: RuntimeWarning: invalid value encountered in sqrt while generating a list

拥有回忆 提交于 2019-12-05 03:00:59

probably xs**2 returns a number > 1 sqrt with negative number will return nan (not a number)

>>> import numpy as np
>>> np.sqrt(-1)
nan

If i am right numpy provides complex numbers functionality which i think is the only way to represent sqrt(x) where x<0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!