0%

numpy access elements trick

1
2
3
4
5
6
7
considering 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.