Getting the shape of two different numpy arrays returns tuples
a.shape
Out[131]: (3,)
A.shape
Out[132]: (3, 3)
Based on the tuples, one is a one-dimensional array (number of dimensions = 1), the other is 2d. How can I detect number of dimensions similar to how type(A)
will tell me one of them is a numpy.ndarray
? should I just use len(a.shape)
?
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加