<li><strong>Shape is a tuple of dimension sizes. A 100x50 RGB image has shape (50, 100, 3).</strong></li>
<li><strong>Axis is an index of a dimension. Leftmost dimension has index 0. Summing the RGB image along axis 2 will return a greyscale image with shape (50, 100).</strong></li>
<pre><codeclass="bash hljs"><2d_bools> = <2d_array>><el/1d/2d_array><spanclass="hljs-comment"># 1d_array must have size of a row.</span>
<1d/2d_a>= <2d_array>[<2d/1d_bools>] <spanclass="hljs-comment"># 1d_bools must have size of a column.</span>
<pre><codeclass="bash hljs"><2d_bools> = <2d>><el/1d/2d><spanclass="hljs-comment"># 1d object must have size of a row.</span>
<1/2d_arr> = <2d>[<2d/1d_bools>]<spanclass="hljs-comment"># 1d_bools must have size of a column.</span>
</code></pre>
<ul>
<li><strong>Indexes should not be tuples because Python converts <codeclass="python hljs"><spanclass="hljs-string">'obj[i, j]'</span></code> to <codeclass="python hljs"><spanclass="hljs-string">'obj[(i, j)]'</span></code>!</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">':'</span></code>returns a slice of all dimension's indexes. Omitted dimensions default to <codeclass="python hljs"><spanclass="hljs-string">':'</span></code>.</strong></li>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">':'</span></code>returns a slice of all dimension's indices. Omitted dimensions default to <codeclass="python hljs"><spanclass="hljs-string">':'</span></code>.</strong></li>
<li><strong>Indices should not be tuples because Python converts <codeclass="python hljs"><spanclass="hljs-string">'obj[i, j]'</span></code> to <codeclass="python hljs"><spanclass="hljs-string">'obj[(i, j)]'</span></code>!</strong></li>
<li><strong>Any value that is broadcastable to the indexed shape can be assigned to the selection.</strong></li>
</ul>
<div><h3id="broadcasting">Broadcasting</h3><p><strong>Set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.</strong></p><pre><codeclass="python language-python hljs">left = [[<spanclass="hljs-number">0.1</span>], [<spanclass="hljs-number">0.6</span>], [<spanclass="hljs-number">0.8</span>]] <spanclass="hljs-comment"># Shape: (3, 1)</span>