成功解决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

解决问题


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





解决思路


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


print(list.shape)




解决方法


y = train_np[:, 0]

print(train_np)  

#修改列表的内容使其不为空列表即可!

大功告成!哈哈!


目录
打赏
0
0
0
0
1044
分享
相关文章
|
11月前
【Simulink】报错:Size mismatch (size [2 x 1] ~= size [1 x 1]). The size to the left is the size of the l
【Simulink】报错:Size mismatch (size [2 x 1] ~= size [1 x 1]). The size to the left is the size of the l
成功解决but is 0 and 2 (computed from start 0 and end 9223372 over shape with rank 2 and stride-1)
成功解决but is 0 and 2 (computed from start 0 and end 9223372 over shape with rank 2 and stride-1)
Python报错:IndexError: index 0 is out of bounds for axis 0 with size 0
Python报错:IndexError: index 0 is out of bounds for axis 0 with size 0
587 0
The size of tensor a (4) must match the size of tensor b (3) at non-singletonThe size of
The size of tensor a (4) must match the size of tensor b (3) at non-singletonThe size of
1387 0
LeetCode 149. Max Points on a Line
给定一个二维平面,平面上有 n 个点,求最多有多少个点在同一条直线上。
138 0
LeetCode 149. Max Points on a Line
成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103
成功解决ValueError: Dimension 1 in both shapes must be equal, but are 1034 and 1024. Shapes are [100,103
Data truncation: Out of range value for column ‘estimate_score‘
Data truncation: Out of range value for column ‘estimate_score‘

热门文章

最新文章

下一篇
oss创建bucket
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等