Browse Source

Pandas

pull/86/head
Jure Šorn 3 years ago
parent
commit
4545c2d9de
3 changed files with 30 additions and 30 deletions
  1. 20
      README.md
  2. 20
      index.html
  3. 20
      parse.js

20
README.md

@ -3209,23 +3209,23 @@ c 6 7
| l.join(r, lsuffix='l', | x yl yr z | | x yl yr z | Joins/merges on row keys.|
| rsuffix='r', | a 1 2 . . | x yl yr z | 1 2 . . | Uses 'left' by default. |
| how=…) | b 3 4 4 5 | 3 4 4 5 | 3 4 4 5 | If r is a series, it is |
| | c . . 6 7 | | | first converted to DF. |
| | c . . 6 7 | | | treated as a column. |
+------------------------+---------------+------------+------------+--------------------------+
| pd.concat([l, r], | x y z | y | | Adds rows at the bottom. |
| axis=0, | a 1 2 . | 2 | | Uses 'outer' by default. |
| join=…) | b 3 4 . | 4 | | By default works the |
| | b . 4 5 | 4 | | same as `l.append(r)`. |
| | c . 6 7 | 6 | | |
| join=…) | b 3 4 . | 4 | | A series is treated as a |
| | b . 4 5 | 4 | | column. Use l.append(r) |
| | c . 6 7 | 6 | | to add a row instead. |
+------------------------+---------------+------------+------------+--------------------------+
| pd.concat([l, r], | x y y z | | | Adds columns at the |
| axis=1, | a 1 2 . . | x y y z | | right end. |
| join=…) | b 3 4 4 5 | 3 4 4 5 | | Uses 'outer' by default. |
| | c . . 6 7 | | | |
| axis=1, | a 1 2 . . | x y y z | | right end. Uses 'outer' |
| join=…) | b 3 4 4 5 | 3 4 4 5 | | by default. A series is |
| | c . . 6 7 | | | treated as a column. |
+------------------------+---------------+------------+------------+--------------------------+
| l.combine_first(r) | x y z | | | Adds missing rows and |
| | a 1 2 . | | | columns. |
| | b 3 4 5 | | | |
| | c . 6 7 | | | |
| | a 1 2 . | | | columns. Also updates |
| | b 3 4 5 | | | cells that contain NaN. |
| | c . 6 7 | | | R must be a DataFrame. |
+------------------------+---------------+------------+------------+--------------------------+
```

20
index.html

@ -2746,23 +2746,23 @@ c <span class="hljs-number">6</span> <span class="hljs-number">7</span>
┃ l.join(r, lsuffix=<span class="hljs-string">'l'</span>, │ x yl yr z │ │ x yl yr z │ Joins/merges on row keys.┃
┃ rsuffix=<span class="hljs-string">'r'</span>, │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . . │ x yl yr z │ <span class="hljs-number">1</span> <span class="hljs-number">2</span> . . │ Uses <span class="hljs-string">'left'</span> by default. ┃
┃ how=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ If r is a series, it is ┃
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ first converted to DF.
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ treated as a column.
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃
┃ axis=<span class="hljs-number">0</span>, │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . │ <span class="hljs-number">2</span> │ │ Uses <span class="hljs-string">'outer'</span> by default. ┃
┃ join=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> . │ <span class="hljs-number">4</span> │ │ By default works the
┃ │ b . <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">4</span> │ │ same as `l.append(r)`.
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span><span class="hljs-number">6</span> │ │
┃ join=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> . │ <span class="hljs-number">4</span> │ │ A series is treated as a
┃ │ b . <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">4</span> │ │ column. Use l.append(r)
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span><span class="hljs-number">6</span> │ │ to add a row instead.
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃
┃ axis=<span class="hljs-number">1</span>, │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . . │ x y y z │ │ right end. ┃
┃ join=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ Uses <span class="hljs-string">'outer'</span> by default.
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │
┃ axis=<span class="hljs-number">1</span>, │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . . │ x y y z │ │ right end. Uses <span class="hljs-string">'outer'</span>
┃ join=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ by default. A series is
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ treated as a column.
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃
┃ │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . │ │ │ columns.
┃ │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ │
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │
┃ │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . │ │ │ columns. Also updates
┃ │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ │ cells that contain NaN.
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ R must be a DataFrame.
┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛
</code></pre>
<div><h4 id="aggregatetransformmap-1">Aggregate, Transform, Map:</h4><pre><code class="python language-python hljs">&lt;Sr&gt; = &lt;DF&gt;.sum/max/mean/idxmax/all() <span class="hljs-comment"># Or: &lt;DF&gt;.apply/agg/transform(&lt;agg_func&gt;)</span>

20
parse.js

@ -347,23 +347,23 @@ const DIAGRAM_15_B =
"┃ l.join(r, lsuffix='l', │ x yl yr z │ │ x yl yr z │ Joins/merges on row keys.┃\n" +
"┃ rsuffix='r', │ a 1 2 . . │ x yl yr z │ 1 2 . . │ Uses 'left' by default. ┃\n" +
"┃ how=…) │ b 3 4 4 5 │ 3 4 4 5 │ 3 4 4 5 │ If r is a series, it is ┃\n" +
"┃ │ c . . 6 7 │ │ │ first converted to DF. ┃\n" +
"┃ │ c . . 6 7 │ │ │ treated as a column. ┃\n" +
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
"┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃\n" +
"┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃\n" +
"┃ join=…) │ b 3 4 . │ 4 │ │ By default works the ┃\n" +
"┃ │ b . 4 5 │ 4 │ │ same as `l.append(r)`. ┃\n" +
"┃ │ c . 6 7 │ 6 │ │ ┃\n" +
"┃ join=…) │ b 3 4 . │ 4 │ │ A series is treated as a ┃\n" +
"┃ │ b . 4 5 │ 4 │ │ column. Use l.append(r) ┃\n" +
"┃ │ c . 6 7 │ 6 │ │ to add a row instead. ┃\n" +
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
"┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃\n" +
"┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. ┃\n" +
"┃ join=…) │ b 3 4 4 5 │ 3 4 4 5 │ │ Uses 'outer' by default. ┃\n" +
"┃ │ c . . 6 7 │ │ │ ┃\n" +
"┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. Uses 'outer' ┃\n" +
"┃ join=…) │ b 3 4 4 5 │ 3 4 4 5 │ │ by default. A series is ┃\n" +
"┃ │ c . . 6 7 │ │ │ treated as a column. ┃\n" +
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
"┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃\n" +
"┃ │ a 1 2 . │ │ │ columns. ┃\n" +
"┃ │ b 3 4 5 │ │ │ ┃\n" +
"┃ │ c . 6 7 │ │ │ ┃\n" +
"┃ │ a 1 2 . │ │ │ columns. Also updates ┃\n" +
"┃ │ b 3 4 5 │ │ │ cells that contain NaN. ┃\n" +
"┃ │ c . 6 7 │ │ │ R must be a DataFrame. ┃\n" +
"┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n";
const DIAGRAM_16_A =

Loading…
Cancel
Save