list indices must be integers or slices, not tuple解决方案-python学习笔记 悠悠的数据分析基地 2021-07-27 2,000 阅读1分钟 原因:多个[]的数组之间没加,逗号 源码: import numpy as np a = np.array([[1,2][3,4]]) print(a) 报错: TypeError: list indices must be integers or slices, not tuple 修改方法: 在[1,2]后面加个英文逗号, import numpy as np a = np.array([[1,2],[3,4]]) print(a)