dims = np.array([[1, 2, 3, 4],[5, 6, 7, 8]])c = 2result = dims[c/2::1, c/2::1]這個在python2.7.10上運行無問題,但在python3.6.2上報錯TypeError: slice indices must be integers or None or have an __index__ method
python3 二維數(shù)組的切片
楊魅力
2018-07-04 21:05:46