<li><strong>Axis is an index of the dimension that gets aggregated. Leftmost dimension has index 0. Summing the RGB image along axis 2 will return a greyscale image with shape (50, 100).</strong></li>
<li><strong>Passing a tuple of axes will chain the operations like this: <codeclass="python hljs"><spanclass="hljs-string">'<array>.<method>(axis_1).<method>(axis_2 - 1 if axis_2 > axis_1 else axis_2)'</span></code>.</strong></li>
<pre><codeclass="bash language-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>
</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>
</ul>
<div><h3id="broadcasting">Broadcasting</h3><p><strong>Broadcasting is a 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>