python二维数组读取数报错TypeError: list indices must be integers or slices, not tuple
如果直接使用如下方法构造二维数据:test_list = [[0] * 5 for _ in range(5)]取数时报错TypeError: list indices must be integers or slices, not tupletest_list[1,2]解决方法使用numpy构造或是使用另一种方法读取数组import numpy as nptest_list = np.array([[0] * 5 for _ in range(5)])print(test_list[