numpy - why Z[(0,2)] is view but Z[(0, 2), (0)] is copy?
问题 Question Why are the numpy tuple indexing behaviors inconsistent? Please explain the rational or design decision behind these behaviors. In my understanding, Z[(0,2)] and Z[(0, 2), (0)] are both tuple indexing and expected the consistent behavior for copy/view. If this is incorrect, please explain, import numpy as np Z = np.arange(36).reshape(3, 3, 4) print("Z is \n{}\n".format(Z)) b = Z[ (0,2) # Select Z[0][2] ] print("Tuple indexing Z[(0,2)] is \n{}\nIs view? {}\n".format( b, b.base is not