Skip to content

Commit e31acdc

Browse files
committed
Pandas
1 parent 25ee450 commit e31acdc

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ import numpy as np
26922692
<2d_bools> = <2d_array> ><== <el/1d/2d_array> # 1d_array must have size of a row.
26932693
<1d/2d_a> = <2d_array>[<2d/1d_bools>] # 1d_bools must have size of a column.
26942694
```
2695-
* **Indexes should not be tuples because Python converts `'obj[i, j]'` to `'obj[(i, j)]'`.**
2695+
* **Indexes should not be tuples because Python converts `'obj[i, j]'` to `'obj[(i, j)]'`!**
26962696
* **Any value that is broadcastable to the indexed shape can be assigned to the selection.**
26972697

26982698
### Broadcasting
@@ -3194,26 +3194,26 @@ y 2
31943194
```
31953195

31963196
```text
3197-
+-----------------+-------------+-------------+---------------+
3198-
| | 'sum' | ['sum'] | {'s': 'sum'} |
3199-
+-----------------+-------------+-------------+---------------+
3200-
| sr.apply(…) | 3 | sum 3 | s 3 |
3201-
| sr.agg(…) | | | |
3202-
+-----------------+-------------+-------------+---------------+
3197+
+---------------+-------------+-------------+---------------+
3198+
| | 'sum' | ['sum'] | {'s': 'sum'} |
3199+
+---------------+-------------+-------------+---------------+
3200+
| sr.apply(…) | 3 | sum 3 | s 3 |
3201+
| sr.agg(…) | | | |
3202+
+---------------+-------------+-------------+---------------+
32033203
```
32043204

32053205
```text
3206-
+-----------------+-------------+-------------+---------------+
3207-
| | 'rank' | ['rank'] | {'r': 'rank'} |
3208-
+-----------------+-------------+-------------+---------------+
3209-
| sr.apply(…) | | rank | |
3210-
| sr.agg(…) | x 1 | x 1 | r x 1 |
3211-
| sr.transform(…) | y 2 | y 2 | y 2 |
3212-
+-----------------+-------------+-------------+---------------+
3213-
```
3214-
* **Methods ffill(), interpolate() and fillna() accept argument 'inplace' that defaults to False.**
3206+
+---------------+-------------+-------------+---------------+
3207+
| | 'rank' | ['rank'] | {'r': 'rank'} |
3208+
+---------------+-------------+-------------+---------------+
3209+
| sr.apply(…) | | rank | |
3210+
| sr.agg(…) | x 1 | x 1 | r x 1 |
3211+
| | y 2 | y 2 | y 2 |
3212+
+---------------+-------------+-------------+---------------+
3213+
```
3214+
* **Keys/indexes/bools can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!**
3215+
* **Methods ffill(), interpolate(), fillna() and dropna() accept `'inplace=True'`.**
32153216
* **Last result has a hierarchical index. Use `'<Sr>[key_1, key_2]'` to get its values.**
3216-
* **Keys/indexes/bools can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`.**
32173217

32183218
### DataFrame
32193219
**Table with labeled rows and columns.**

index.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<body>
5656
<header>
57-
<aside>March 13, 2023</aside>
57+
<aside>March 21, 2023</aside>
5858
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
5959
</header>
6060

@@ -2204,7 +2204,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
22042204
&lt;1d/2d_a&gt; = &lt;2d_array&gt;[&lt;2d/1d_bools&gt;] <span class="hljs-comment"># 1d_bools must have size of a column.</span>
22052205
</code></pre>
22062206
<ul>
2207-
<li><strong>Indexes should not be tuples because Python converts <code class="python hljs"><span class="hljs-string">'obj[i, j]'</span></code> to <code class="python hljs"><span class="hljs-string">'obj[(i, j)]'</span></code>.</strong></li>
2207+
<li><strong>Indexes should not be tuples because Python converts <code class="python hljs"><span class="hljs-string">'obj[i, j]'</span></code> to <code class="python hljs"><span class="hljs-string">'obj[(i, j)]'</span></code>!</strong></li>
22082208
<li><strong>Any value that is broadcastable to the indexed shape can be assigned to the selection.</strong></li>
22092209
</ul>
22102210
<div><h3 id="broadcasting">Broadcasting</h3><p><strong>Set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.</strong></p><pre><code class="python language-python hljs">left = [[<span class="hljs-number">0.1</span>], [<span class="hljs-number">0.6</span>], [<span class="hljs-number">0.8</span>]] <span class="hljs-comment"># Shape: (3, 1)</span>
@@ -2607,26 +2607,26 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
26072607
x <span class="hljs-number">1</span>
26082608
y <span class="hljs-number">2</span>
26092609
</code></pre>
2610-
<pre><code class="python hljs">┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
2611-
<span class="hljs-string">'sum'</span> │ [<span class="hljs-string">'sum'</span>] │ {<span class="hljs-string">'s'</span>: <span class="hljs-string">'sum'</span>} ┃
2612-
┠─────────────────┼─────────────┼─────────────┼───────────────┨
2613-
┃ sr.apply(…) <span class="hljs-number">3</span> │ sum <span class="hljs-number">3</span> │ s <span class="hljs-number">3</span>
2614-
┃ sr.agg(…) │ │ │ ┃
2615-
┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
2610+
<pre><code class="python hljs">┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
2611+
┃ │ <span class="hljs-string">'sum'</span> │ [<span class="hljs-string">'sum'</span>] │ {<span class="hljs-string">'s'</span>: <span class="hljs-string">'sum'</span>} ┃
2612+
┠───────────────┼─────────────┼─────────────┼───────────────┨
2613+
┃ sr.apply(…) │ <span class="hljs-number">3</span> │ sum <span class="hljs-number">3</span> │ s <span class="hljs-number">3</span>
2614+
┃ sr.agg(…) │ │ │ ┃
2615+
┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
26162616

2617-
┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
2618-
<span class="hljs-string">'rank'</span> │ [<span class="hljs-string">'rank'</span>] │ {<span class="hljs-string">'r'</span>: <span class="hljs-string">'rank'</span>} ┃
2619-
┠─────────────────┼─────────────┼─────────────┼───────────────┨
2620-
┃ sr.apply(…) │ │ rank │ ┃
2621-
┃ sr.agg(…) │ x <span class="hljs-number">1</span> │ x <span class="hljs-number">1</span> │ r x <span class="hljs-number">1</span>
2622-
sr.transform(…) │ y <span class="hljs-number">2</span> │ y <span class="hljs-number">2</span> │ y <span class="hljs-number">2</span>
2623-
┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
2617+
┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
2618+
┃ │ <span class="hljs-string">'rank'</span> │ [<span class="hljs-string">'rank'</span>] │ {<span class="hljs-string">'r'</span>: <span class="hljs-string">'rank'</span>} ┃
2619+
┠───────────────┼─────────────┼─────────────┼───────────────┨
2620+
┃ sr.apply(…) │ │ rank │ ┃
2621+
┃ sr.agg(…) │ x <span class="hljs-number">1</span> │ x <span class="hljs-number">1</span> │ r x <span class="hljs-number">1</span>
2622+
│ y <span class="hljs-number">2</span> │ y <span class="hljs-number">2</span> │ y <span class="hljs-number">2</span>
2623+
┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
26242624
</code></pre>
26252625

26262626
<ul>
2627-
<li><strong>Methods ffill(), interpolate() and fillna() accept argument 'inplace' that defaults to False.</strong></li>
2627+
<li><strong>Keys/indexes/bools can't be tuples because <code class="python hljs"><span class="hljs-string">'obj[x, y]'</span></code> is converted to <code class="python hljs"><span class="hljs-string">'obj[(x, y)]'</span></code>!</strong></li>
2628+
<li><strong>Methods ffill(), interpolate(), fillna() and dropna() accept <code class="python hljs"><span class="hljs-string">'inplace=True'</span></code>.</strong></li>
26282629
<li><strong>Last result has a hierarchical index. Use <code class="python hljs"><span class="hljs-string">'&lt;Sr&gt;[key_1, key_2]'</span></code> to get its values.</strong></li>
2629-
<li><strong>Keys/indexes/bools can't be tuples because <code class="python hljs"><span class="hljs-string">'obj[x, y]'</span></code> is converted to <code class="python hljs"><span class="hljs-string">'obj[(x, y)]'</span></code>.</strong></li>
26302630
</ul>
26312631
<div><h3 id="dataframe">DataFrame</h3><p><strong>Table with labeled rows and columns.</strong></p><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span>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>])
26322632
x y
@@ -2934,7 +2934,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29342934

29352935

29362936
<footer>
2937-
<aside>March 13, 2023</aside>
2937+
<aside>March 21, 2023</aside>
29382938
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29392939
</footer>
29402940

parse.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -496,26 +496,26 @@ const DIAGRAM_12_B =
496496
'┗━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━┛\n';
497497

498498
const DIAGRAM_13_A =
499-
'| sr.apply(…) | 3 | sum 3 | s 3 |';
499+
'| sr.apply(…) | 3 | sum 3 | s 3 |';
500500

501501
const DIAGRAM_13_B =
502-
"┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
503-
"┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" +
504-
"┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" +
505-
"┃ sr.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" +
506-
"┃ sr.agg(…) │ │ │ ┃\n" +
507-
"┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n" +
502+
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
503+
"┃ │ 'sum' │ ['sum'] │ {'s': 'sum'} ┃\n" +
504+
"┠───────────────┼─────────────┼─────────────┼───────────────┨\n" +
505+
"┃ sr.apply(…) │ 3 │ sum 3 │ s 3 ┃\n" +
506+
"┃ sr.agg(…) │ │ │ ┃\n" +
507+
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n" +
508508
"\n" +
509-
"┏━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
510-
"┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" +
511-
"┠─────────────────┼─────────────┼─────────────┼───────────────┨\n" +
512-
"┃ sr.apply(…) │ │ rank │ ┃\n" +
513-
"┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃\n" +
514-
"┃ sr.transform(…) │ y 2 │ y 2 │ y 2 ┃\n" +
515-
"┗━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n";
509+
"┏━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
510+
"┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃\n" +
511+
"┠───────────────┼─────────────┼─────────────┼───────────────┨\n" +
512+
"┃ sr.apply(…) │ │ rank │ ┃\n" +
513+
"┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃\n" +
514+
"┃ │ y 2 │ y 2 │ y 2 ┃\n" +
515+
"┗━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n";
516516

517517
const DIAGRAM_14_A =
518-
"| | 'rank' | ['rank'] | {'r': 'rank'} |";
518+
"| | 'rank' | ['rank'] | {'r': 'rank'} |";
519519

520520
const DIAGRAM_15_A =
521521
'+------------------------+---------------+------------+------------+--------------------------+';

0 commit comments

Comments
 (0)