Len () from numpy array in python
What is an len
equivalent nested list?
len([[2,3,1,0], [2,3,1,0], [3,2,1,1]])
With a more general concept shape
, the numpy
developers decided to implement __len__
as the first dimension. Python maps len(obj)
to obj.__len__
.
X.shape
It returns a tuple, which has a len
- number of measurements X.ndim
. X.shape[i]
selects the size ith
(direct tuple indexing application).
source to share