Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4545c2d

Browse files
committed
Pandas
1 parent 711a407 commit 4545c2d

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,23 +3209,23 @@ c 6 7
32093209
| l.join(r, lsuffix='l', | x yl yr z | | x yl yr z | Joins/merges on row keys.|
32103210
| rsuffix='r', | a 1 2 . . | x yl yr z | 1 2 . . | Uses 'left' by default. |
32113211
| how=…) | b 3 4 4 5 | 3 4 4 5 | 3 4 4 5 | If r is a series, it is |
3212-
| | c . . 6 7 | | | first converted to DF. |
3212+
| | c . . 6 7 | | | treated as a column. |
32133213
+------------------------+---------------+------------+------------+--------------------------+
32143214
| pd.concat([l, r], | x y z | y | | Adds rows at the bottom. |
32153215
| axis=0, | a 1 2 . | 2 | | Uses 'outer' by default. |
3216-
| join=…) | b 3 4 . | 4 | | By default works the |
3217-
| | b . 4 5 | 4 | | same as `l.append(r)`. |
3218-
| | c . 6 7 | 6 | | |
3216+
| join=…) | b 3 4 . | 4 | | A series is treated as a |
3217+
| | b . 4 5 | 4 | | column. Use l.append(r) |
3218+
| | c . 6 7 | 6 | | to add a row instead. |
32193219
+------------------------+---------------+------------+------------+--------------------------+
32203220
| pd.concat([l, r], | x y y z | | | Adds columns at the |
3221-
| axis=1, | a 1 2 . . | x y y z | | right end. |
3222-
| join=…) | b 3 4 4 5 | 3 4 4 5 | | Uses 'outer' by default. |
3223-
| | c . . 6 7 | | | |
3221+
| axis=1, | a 1 2 . . | x y y z | | right end. Uses 'outer' |
3222+
| join=…) | b 3 4 4 5 | 3 4 4 5 | | by default. A series is |
3223+
| | c . . 6 7 | | | treated as a column. |
32243224
+------------------------+---------------+------------+------------+--------------------------+
32253225
| l.combine_first(r) | x y z | | | Adds missing rows and |
3226-
| | a 1 2 . | | | columns. |
3227-
| | b 3 4 5 | | | |
3228-
| | c . 6 7 | | | |
3226+
| | a 1 2 . | | | columns. Also updates |
3227+
| | b 3 4 5 | | | cells that contain NaN. |
3228+
| | c . 6 7 | | | R must be a DataFrame. |
32293229
+------------------------+---------------+------------+------------+--------------------------+
32303230
```
32313231

index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,23 +2746,23 @@
27462746
┃ l.join(r, lsuffix=<span class="hljs-string">'l'</span>, │ x yl yr z │ │ x yl yr z │ Joins/merges on row keys.┃
27472747
┃ 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. ┃
27482748
┃ 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 ┃
2749-
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ first converted to DF.
2749+
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ treated as a column.
27502750
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
27512751
┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃
27522752
┃ 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. ┃
2753-
┃ join=…) │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> . │ <span class="hljs-number">4</span> │ │ By default works the
2754-
┃ │ b . <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">4</span> │ │ same as `l.append(r)`.
2755-
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span><span class="hljs-number">6</span> │ │
2753+
┃ 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
2754+
┃ │ b . <span class="hljs-number">4</span> <span class="hljs-number">5</span><span class="hljs-number">4</span> │ │ column. Use l.append(r) ┃
2755+
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span><span class="hljs-number">6</span> │ │ to add a row instead.
27562756
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
27572757
┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃
2758-
┃ 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.
2759-
┃ 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. ┃
2760-
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │
2758+
┃ 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>
2759+
┃ 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
2760+
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ treated as a column.
27612761
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
27622762
┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃
2763-
┃ │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . │ │ │ columns.
2764-
┃ │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ │
2765-
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │
2763+
┃ │ a <span class="hljs-number">1</span> <span class="hljs-number">2</span> . │ │ │ columns. Also updates
2764+
┃ │ b <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> │ │ │ cells that contain NaN.
2765+
┃ │ c . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ R must be a DataFrame.
27662766
┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛
27672767
</code></pre>
27682768
<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>

parse.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,23 +347,23 @@ const DIAGRAM_15_B =
347347
"┃ l.join(r, lsuffix='l', │ x yl yr z │ │ x yl yr z │ Joins/merges on row keys.┃\n" +
348348
"┃ rsuffix='r', │ a 1 2 . . │ x yl yr z │ 1 2 . . │ Uses 'left' by default. ┃\n" +
349349
"┃ how=…) │ b 3 4 4 5 │ 3 4 4 5 │ 3 4 4 5 │ If r is a series, it is ┃\n" +
350-
"┃ │ c . . 6 7 │ │ │ first converted to DF. ┃\n" +
350+
"┃ │ c . . 6 7 │ │ │ treated as a column. ┃\n" +
351351
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
352352
"┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃\n" +
353353
"┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃\n" +
354-
"┃ join=…) │ b 3 4 . │ 4 │ │ By default works the ┃\n" +
355-
"┃ │ b . 4 5 │ 4 │ │ same as `l.append(r)`. ┃\n" +
356-
"┃ │ c . 6 7 │ 6 │ │ ┃\n" +
354+
"┃ join=…) │ b 3 4 . │ 4 │ │ A series is treated as a ┃\n" +
355+
"┃ │ b . 4 5 │ 4 │ │ column. Use l.append(r) ┃\n" +
356+
"┃ │ c . 6 7 │ 6 │ │ to add a row instead. ┃\n" +
357357
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
358358
"┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃\n" +
359-
"┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. ┃\n" +
360-
"┃ join=…) │ b 3 4 4 5 │ 3 4 4 5 │ │ Uses 'outer' by default. ┃\n" +
361-
"┃ │ c . . 6 7 │ │ │ ┃\n" +
359+
"┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. Uses 'outer' ┃\n" +
360+
"┃ join=…) │ b 3 4 4 5 │ 3 4 4 5 │ │ by default. A series is ┃\n" +
361+
"┃ │ c . . 6 7 │ │ │ treated as a column. ┃\n" +
362362
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
363363
"┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃\n" +
364-
"┃ │ a 1 2 . │ │ │ columns. ┃\n" +
365-
"┃ │ b 3 4 5 │ │ │ ┃\n" +
366-
"┃ │ c . 6 7 │ │ │ ┃\n" +
364+
"┃ │ a 1 2 . │ │ │ columns. Also updates ┃\n" +
365+
"┃ │ b 3 4 5 │ │ │ cells that contain NaN. ┃\n" +
366+
"┃ │ c . 6 7 │ │ │ R must be a DataFrame. ┃\n" +
367367
"┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n";
368368

369369
const DIAGRAM_16_A =

0 commit comments

Comments
 (0)