You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanclass="name">Z</span><spanclass="operator">=</span><spanclass="name">np</span><spanclass="operator">.</span><spanclass="name">arange</span><spanclass="punctuation">(</span><spanclass="literal number integer">9</span><spanclass="punctuation">)</span><spanclass="operator">.</span><spanclass="name">reshape</span><spanclass="punctuation">(</span><spanclass="literal number integer">3</span><spanclass="punctuation">,</span><spanclass="literal number integer">3</span><spanclass="punctuation">)</span><spanclass="operator">.</span><spanclass="name">astype</span><spanclass="punctuation">(</span><spanclass="name">np</span><spanclass="operator">.</span><spanclass="name">int16</span><spanclass="punctuation">)</span>
469
469
</pre>
470
470
<p>Here, we know that Z itemsize is 2 bytes (<code>int16</code>), the shape is (3,3) and
471
-
the number of dimensions is 2 (<code>len(shape)</code>).</p>
471
+
the number of dimensions is 2 (<code>len(Z.shape)</code>).</p>
0 commit comments