denngyu 发表于 2020-3-23 14:05:17

出现错误IndexError: index 1 is out of bounds for axis 0 with size 1

本帖最后由 一个账号 于 2020-3-23 14:15 编辑

import numpy as np
import random

i = 0
s = random.uniform(-1.5, 1.5)
X = np.random.randint(-1000, 1000, (1 , 1000))
Y = np.ones(, dtype=float)



def   fun(x):
    return 8.0*x + 9.0 + s

while   i < 1002:
    Y = fun(X)
    print(Y)
    print(X)
    i += 1
页: [1]
查看完整版本: 出现错误IndexError: index 1 is out of bounds for axis 0 with size 1