目的:在指定的间隔内返回均匀间隔的数字
用法:numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)
参数:
-> start : 起始位置
-> stop : 终点未知
-> restep : 默认false,走一步幅度为1.你也可以自己设置步幅
-> num : 你要多少个样本
-> dtype : 输出的类型
实例:
print("B\n", geek.linspace(2.0, 3.0, num=5, retstep=True), "\n")
output:(array([2. , 2.25, 2.5 , 2.75, 3. ]), 0.25)