numpy access elements trick Posted on 2019-01-11 Edited on 2019-03-21 In code Valine: 1234567considering a numpy matrix mat with shape[10,7,1,2]if we want to access the FIRST column of mat, which has shape[10]then we should use: mat[:,0,0,0]instead of: mat[:][0][0][0] (return the shape of [5]) cause mat = mat[:] actully.