dims = np.array([[1, 2, 3, 4],[5, 6, 7, 8]])
c = 2
result = dims[c/2::1, c/2::1]
这个在python2.7.10上运行无问题,但在python3.6.2上报错
python3.6.2上报错
TypeError: slice indices must be integers or None or have an __index__ method
茅侃侃