解决IndexError: index 0 is out of bounds for axis 1 with size 0错误

解决问题

IndexError: index 0 is out of bounds for axis 1 with size 0

思路

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

解决方法

y = train_np[:, 0]
 
print(train_np)  
 

你可能感兴趣的:(python)