TypeError: list indices must be integers or slices, not tuple
TypeError: list indices must be integers or slices, not tuple今天在写python程序的时候遇到这样的报错。大概查了一下,发现是list切片的问题。也就是说list的索引只能是整数或切片(正如报错所说),所以使用如下操作时,就会报错data = [[0,1],[2,3],[3,4]]print(data[:,1]一种解决方法就是把data转换成narray。data = [[0,1],[2,3],[3,4]]data = np.ar