What is the order of elements in an image in python? I have a set of images which are loaded from an h5 file. I checked their dimensions and I get (209, 64, 64, 3).

read = h5py.File('datasets/train_catvnoncat.h5', 'r')
read['train_set_x'].shape



  (209, 64, 64, 3)


it means that there are 209 images but the point that I cannot understand is that, what is (64, 64, 3)? 
I have used the following code for plotting: 

import matplotlib.pyplot as plt

plt.imshow(read['train_set_x'][1])
plt.show()


and I get a colored image which is 64 by 64. before this, I thought for (., ., .) shapes, the second number specifies the number of lines and the third one specifies the number of rows. also the first one specifies the number of the mentioned (row and column) arrays.
My question is that in numpy if you have a three dimensional array, for accessing rows and columns you have to change the second and third entries in the indexing operator; Why this is different in images and rows and columns are arranged differently in images. Shouldn't it be (3, 64, 64)?
The [64, 64, 3] shape you have found is a common convention to represent a colour image in (x, y, colour_channel) dimensions. 

The key word here is convention - there is no inherently preferred way to represent a colour image in terms of fundamental maths or computing needs, and even within Python you will find multiple conventions, varying in the ordering within the dimension - e.g. OpenCV uses (x, y, channel) convention for the shape, but has channels in order BGR - so channel 0 is blue - whilst most other libraries will use RGB ordering (ignoring for now the alternative colour spaces).


  My question is that in numpy if you have a three dimensional array, for accessing rows and columns you have to change the second and third entries in the indexing operator


When you have a 3-dimensional array, what you decide to call "rows" and "columns" is also a convention. It depends partly on what that array represents, and there is no single way to visualise the contents.