python/numpy: how to get 2D array column length?
You could use np.size(element,dimension)
.
In your case:
a.shape
>> (1, 21)
np.size(a,0)
>> 1
np.size(a,1)
>> 21
You can get the second dimension of the array as:
a.shape[1]
You could use np.size(element,dimension)
.
In your case:
a.shape
>> (1, 21)
np.size(a,0)
>> 1
np.size(a,1)
>> 21
You can get the second dimension of the array as:
a.shape[1]