Get total size/length of multi-dimensional array using NumPy

Use size property, instead of len function.

a.size

Remarks:

Python’s len function will not give number of elements in NumPy multi-dimensional array.

size property is the multiplication of all items in shape property.

References: