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

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

大功告成!哈哈!


相关文章
|
索引 Python
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
395 0
LeetCode 149. Max Points on a Line
给定一个二维平面,平面上有 n 个点,求最多有多少个点在同一条直线上。
109 0
LeetCode 149. Max Points on a Line
|
索引 Python
成功解决ValueError: column index (256) not an int in range(256)
成功解决ValueError: column index (256) not an int in range(256)
成功解决ValueError: column index (256) not an int in range(256)
成功解决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‘
成功解决IndexError: index 14 is out of bounds for axis 1 with size 14
成功解决IndexError: index 14 is out of bounds for axis 1 with size 14