小编Kil*_*out的帖子

Polyfit 返回“nan”,而 x 和 y 在 Python 中没有“nan”或“inf”值

我遇到了 polyfit 的问题,无法找到解决方案。我有一个双对数图,我尝试在其中进行polyfit。“x”和“y”都没有任何“nan”或“inf”值。当我运行 polyfit 时,我得到的只是 nan

  np.polyfit(x,y,1)
Run Code Online (Sandbox Code Playgroud)

结果

  array([nan, nan])
Run Code Online (Sandbox Code Playgroud)

想知道是什么原因。我使用的 x 和 y 大小为 524288,因此很难共享。提前致谢。

python numpy nan

2
推荐指数
1
解决办法
1669
查看次数

标签 统计

nan ×1

numpy ×1

python ×1