|
1017 | 1017 | (<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>)
|
1018 | 1018 | </code></pre>
|
1019 | 1019 | <div><h3 id="contextmanager">Context Manager</h3><ul>
|
1020 |
| -<li><strong>With statements only work with objects that have enter() and exit() special methods.</strong></li> |
| 1020 | +<li><strong>With statements only work on objects that have enter() and exit() special methods.</strong></li> |
1021 | 1021 | <li><strong>Enter() should lock the resources and optionally return an object.</strong></li>
|
1022 | 1022 | <li><strong>Exit() should release the resources.</strong></li>
|
1023 | 1023 | <li><strong>Any exception that happens inside the with block is passed to the exit() method.</strong></li>
|
@@ -1781,7 +1781,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
1781 | 1781 | </ul>
|
1782 | 1782 | <div><h2 id="operator"><a href="#operator" name="operator">#</a>Operator</h2><p><strong>Module of functions that provide the functionality of operators. Functions are ordered by operator precedence, starting with least binding.</strong></p><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> operator <span class="hljs-keyword">as</span> op
|
1783 | 1783 | <bool> = op.not_(<obj>) <span class="hljs-comment"># or, and, not (or/and missing)</span>
|
1784 |
| -<bool> = op.eq/ne/lt/le/gt/ge/contains/is_(<obj>, <obj>) <span class="hljs-comment"># ==, !=, <, <=, >, >=, in, is</span> |
| 1784 | +<bool> = op.eq/ne/lt/le/gt/ge/is_/contains(<obj>, <obj>) <span class="hljs-comment"># ==, !=, <, <=, >, >=, is, in</span> |
1785 | 1785 | <obj> = op.or_/xor/and_(<int/set>, <int/set>) <span class="hljs-comment"># |, ^, &</span>
|
1786 | 1786 | <int> = op.lshift/rshift(<int>, <int>) <span class="hljs-comment"># <<, >></span>
|
1787 | 1787 | <obj> = op.add/sub/mul/truediv/floordiv/mod(<obj>, <obj>) <span class="hljs-comment"># +, -, *, /, //, %</span>
|
@@ -2190,7 +2190,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2190 | 2190 | <view> = <array>.transpose() <span class="hljs-comment"># Or: <array>.T</span>
|
2191 | 2191 | </code></pre>
|
2192 | 2192 | <pre><code class="python language-python hljs"><array> = np.copy/abs/sqrt/log/int64(<array>) <span class="hljs-comment"># Returns new array of the same shape.</span>
|
2193 |
| -<array> = <array>.sum/max/mean/argmax/all(axis) <span class="hljs-comment"># Passed dimension gets aggregated.</span> |
| 2193 | +<array> = <array>.sum/max/mean/argmax/all(axis) <span class="hljs-comment"># Aggregates specified dimension.</span> |
2194 | 2194 | <array> = np.apply_along_axis(<func>, axis, <array>) <span class="hljs-comment"># Func can return a scalar or array.</span>
|
2195 | 2195 | </code></pre>
|
2196 | 2196 | <pre><code class="python language-python hljs"><array> = np.concatenate(<list_of_arrays>, axis=<span class="hljs-number">0</span>) <span class="hljs-comment"># Links arrays along first axis (rows).</span>
|
|
0 commit comments