* **Code inside the `'else'` block will only be executed if `'try'` block had no exceptions.**
* **Code inside the `'finally'` block will always be executed (unless a signal is received).**
* **All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try/except clause (only function block delimits scope).**
* **All variables that are initialized in executed blocks are also visible in all subsequent blocks
, as well as outside the try statement (only function block delimits scope).**
* **To catch signals use `'signal.signal(signal_number, <func>)'`.**
<li><strong>Code inside the <codeclass="python hljs"><spanclass="hljs-string">'else'</span></code> block will only be executed if <codeclass="python hljs"><spanclass="hljs-string">'try'</span></code> block had no exceptions.</strong></li>
<li><strong>Code inside the <codeclass="python hljs"><spanclass="hljs-string">'finally'</span></code> block will always be executed (unless a signal is received).</strong></li>
<li><strong>All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try/except clause (only function block delimits scope).</strong></li>
<li><strong>All variables that are initialized in executed blocks are also visible in all subsequent blocks
, as well as outside the try statement (only function block delimits scope).</strong></li>
<li><strong>To catch signals use <codeclass="python hljs"><spanclass="hljs-string">'signal.signal(signal_number, <func>)'</span></code>.</strong></li>
<pre><codeclass="python language-python hljs"><Sr> = <Sr>><el/Sr><spanclass="hljs-comment"># Returns a Series of bools.</span>
@ -2631,7 +2632,7 @@ y <span class="hljs-number">3</span>
</code></pre>
<ul>
<li><strong>Keys/indexes/bools can't be tuples because <codeclass="python hljs"><spanclass="hljs-string">'obj[x, y]'</span></code> is converted to <codeclass="python hljs"><spanclass="hljs-string">'obj[(x, y)]'</span></code>!</strong></li>
<li><strong>Keys/indices/bools can't be tuples because <codeclass="python hljs"><spanclass="hljs-string">'obj[x, y]'</span></code> is converted to <codeclass="python hljs"><spanclass="hljs-string">'obj[(x, y)]'</span></code>!</strong></li>
<li><strong>Methods ffill(), interpolate(), fillna() and dropna() accept <codeclass="python hljs"><spanclass="hljs-string">'inplace=True'</span></code>.</strong></li>
<li><strong>Last result has a hierarchical index. Use <codeclass="python hljs"><spanclass="hljs-string">'<Sr>[key_1, key_2]'</span></code> to get its values.</strong></li>
</ul>
@ -2645,22 +2646,22 @@ b <span class="hljs-number">3</span> <span class="hljs-number">4</span>
<pre><codeclass="python language-python hljs"><DF> = pd.DataFrame(<list_of_rows>) <spanclass="hljs-comment"># Rows can be either lists, dicts or series.</span>
<DF> = pd.DataFrame(<dict_of_columns>) <spanclass="hljs-comment"># Columns can be either lists, dicts or series.</span>
<DF> = <DF>[row_bools] <spanclass="hljs-comment"># Keeps rows as specified by bools.</span>
<DF> = <DF>[<DF_of_bools>] <spanclass="hljs-comment"># Assigns NaN to items that are False in bools.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><DF> = <DF>><el/Sr/DF><spanclass="hljs-comment"># Returns DF of bools. Sr is treated as a row.</span>
<DF> = <DF> + <el/Sr/DF><spanclass="hljs-comment"># Items with non-matching keys get value NaN.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><DF> = <DF>.set_index(column_key) <spanclass="hljs-comment"># Replaces row keys with values from the column.</span>
<DF> = <DF>.reset_index(drop=<spanclass="hljs-keyword">False</span>) <spanclass="hljs-comment"># Drops or moves row keys to column named index.</span>
<DF> = <DF>.sort_index(ascending=<spanclass="hljs-keyword">True</span>) <spanclass="hljs-comment"># Sorts rows by row keys. Use `axis=1` for cols.</span>
<DF> = <DF>.sort_values(column_key/s) <spanclass="hljs-comment"># Sorts rows by passed column/s. Also `axis=1`.</span>
<DF> = <DF>.sort_values(col_key/s)<spanclass="hljs-comment"># Sorts rows by passed column/s. Also `axis=1`.</span>