|
54 | 54 |
|
55 | 55 | <body>
|
56 | 56 | <header>
|
57 |
| - <aside>September 16, 2023</aside> |
| 57 | + <aside>September 17, 2023</aside> |
58 | 58 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a>
|
59 | 59 | </header>
|
60 | 60 |
|
@@ -2196,7 +2196,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2196 | 2196 | <1d_array> = <2d_array>[row_indexes, column_indexes] <span class="hljs-comment"># <3d_a>[table_i/is, row_is, column_is]</span>
|
2197 | 2197 | <1d_array> = <2d_array>[row_indexes, column_index] <span class="hljs-comment"># <3d_a>[table_i/is, row_is, column_i]</span>
|
2198 | 2198 | </code></pre>
|
2199 |
| -<pre><code class="bash hljs"><2d_bools> = <2d_array> ><== <el/1d/2d_array> <span class="hljs-comment"># 1d_array must have size of a row.</span> |
| 2199 | +<pre><code class="bash hljs"><2d_bools> = <2d_array> > <el/1d/2d_array> <span class="hljs-comment"># 1d_array must have size of a row.</span> |
2200 | 2200 | <1d/2d_a> = <2d_array>[<2d/1d_bools>] <span class="hljs-comment"># 1d_bools must have size of a column.</span>
|
2201 | 2201 | </code></pre>
|
2202 | 2202 | <ul>
|
@@ -2584,8 +2584,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2584 | 2584 | <Sr> = <Sr>[keys/indexes] <span class="hljs-comment"># Or: <Sr>[<keys_slice/slice>]</span>
|
2585 | 2585 | <Sr> = <Sr>[bools] <span class="hljs-comment"># Or: <Sr>.loc/iloc[bools]</span>
|
2586 | 2586 | </code></pre>
|
2587 |
| -<pre><code class="python language-python hljs"><Sr> = <Sr> ><== <el/Sr> <span class="hljs-comment"># Returns a Series of bools.</span> |
2588 |
| -<Sr> = <Sr> +-*/ <el/Sr> <span class="hljs-comment"># Items with non-matching keys get value NaN.</span> |
| 2587 | +<pre><code class="python language-python hljs"><Sr> = <Sr> > <el/Sr> <span class="hljs-comment"># Returns a Series of bools.</span> |
| 2588 | +<Sr> = <Sr> + <el/Sr> <span class="hljs-comment"># Items with non-matching keys get value NaN.</span> |
2589 | 2589 | </code></pre>
|
2590 | 2590 | <pre><code class="python language-python hljs"><Sr> = pd.concat(<coll_of_Sr>) <span class="hljs-comment"># Concats multiple Series into one long Series.</span>
|
2591 | 2591 | <Sr> = <Sr>.combine_first(<Sr>) <span class="hljs-comment"># Adds items that are not yet present.</span>
|
@@ -2641,15 +2641,15 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2641 | 2641 | </code></pre>
|
2642 | 2642 | <pre><code class="python language-python hljs"><Sr/DF> = <DF>[column_key/s] <span class="hljs-comment"># Or: <DF>.column_key</span>
|
2643 | 2643 | <DF> = <DF>[row_bools] <span class="hljs-comment"># Keeps rows as specified by bools.</span>
|
2644 |
| -<DF> = <DF>[<DF_of_bools>] <span class="hljs-comment"># Assigns NaN to False values.</span> |
| 2644 | +<DF> = <DF>[<DF_of_bools>] <span class="hljs-comment"># Assigns NaN to values that are False in bools.</span> |
2645 | 2645 | </code></pre>
|
2646 |
| -<pre><code class="python language-python hljs"><DF> = <DF> ><== <el/Sr/DF> <span class="hljs-comment"># Returns DF of bools. Sr is treated as a row.</span> |
2647 |
| -<DF> = <DF> +-*/ <el/Sr/DF> <span class="hljs-comment"># Items with non-matching keys get value NaN.</span> |
| 2646 | +<pre><code class="python language-python hljs"><DF> = <DF> > <el/Sr/DF> <span class="hljs-comment"># Returns DF of bools. Sr is treated as a row.</span> |
| 2647 | +<DF> = <DF> + <el/Sr/DF> <span class="hljs-comment"># Items with non-matching keys get value NaN.</span> |
2648 | 2648 | </code></pre>
|
2649 |
| -<pre><code class="python language-python hljs"><DF> = <DF>.set_index(column_key) <span class="hljs-comment"># Replaces row keys with values from a column.</span> |
| 2649 | +<pre><code class="python language-python hljs"><DF> = <DF>.set_index(column_key) <span class="hljs-comment"># Replaces row keys with values from the column.</span> |
2650 | 2650 | <DF> = <DF>.reset_index(drop=<span class="hljs-keyword">False</span>) <span class="hljs-comment"># Drops or moves row keys to column named index.</span>
|
2651 | 2651 | <DF> = <DF>.sort_index(ascending=<span class="hljs-keyword">True</span>) <span class="hljs-comment"># Sorts rows by row keys. Use `axis=1` for cols.</span>
|
2652 |
| -<DF> = <DF>.sort_values(column_key/s) <span class="hljs-comment"># Sorts rows by the passed column/s. Same.</span> |
| 2652 | +<DF> = <DF>.sort_values(column_key/s) <span class="hljs-comment"># Sorts rows by passed column/s. Also `axis=1`.</span> |
2653 | 2653 | </code></pre>
|
2654 | 2654 | <div><h4 id="dataframemergejoinconcat">DataFrame — Merge, Join, Concat:</h4><pre><code class="python language-python hljs"><span class="hljs-meta">>>> </span>l = pd.DataFrame([[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>], [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>]], index=[<span class="hljs-string">'a'</span>, <span class="hljs-string">'b'</span>], columns=[<span class="hljs-string">'x'</span>, <span class="hljs-string">'y'</span>])
|
2655 | 2655 | x y
|
@@ -2928,7 +2928,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2928 | 2928 |
|
2929 | 2929 |
|
2930 | 2930 | <footer>
|
2931 |
| - <aside>September 16, 2023</aside> |
| 2931 | + <aside>September 17, 2023</aside> |
2932 | 2932 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a>
|
2933 | 2933 | </footer>
|
2934 | 2934 |
|
|
0 commit comments