小编Tho*_*oet的帖子

为什么我的 NumPy logspace 给我一个无穷大的数组?

为了获得 1000 到 1000000000 的对数数组,有 23 个点,我用 Python 编写了以下代码:

import numpy as np

x4 = np.logspace(start=1000, stop=1000000000, num=23, base=10)
print(x4)
Run Code Online (Sandbox Code Playgroud)

结果如下:

[inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf]
Run Code Online (Sandbox Code Playgroud)

你如何解决这个问题以及我的代码做错了什么?

python numpy

6
推荐指数
1
解决办法
1131
查看次数

标签 统计

numpy ×1

python ×1