成功解决IndexError: index 0 is out of bounds for axis 1 with size 0

解决思路

查看列表,输出列表内容,查看列表的形状,发现列表的确是空值,所以修改列表内容即可!

print(list.shape)

 解决方法

y = train_np[:, 0]
 
print(train_np)  
 
 
#修改列表的内容使其不为空列表即可!

         完事快去试试吧

你可能感兴趣的:(python,人工智能)