Browse Source

Duck types, Pandas

pull/83/head
Jure Šorn 4 years ago
parent
commit
4c18e178ff
4 changed files with 9 additions and 9 deletions
  1. 6
      README.md
  2. 6
      index.html
  3. 4
      parse.js
  4. 2
      pdf/remove_links.py

6
README.md

@ -1237,7 +1237,7 @@ class MyCollection:
* **Only required methods are len() and getitem().**
* **Getitem() should return an item at index or raise IndexError.**
* **Iter() and contains() automatically work on any object that has getitem() defined.**
* **Reversed() automatically works on any object that has getitem() and len() defined.**
* **Reversed() automatically works on any object that has len() and getitem() defined.**
```python
class MySequence:
def __init__(self, a):
@ -3210,8 +3210,8 @@ 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 |
| | c . . 6 7 | | | is first converted to DF.|
| 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. |
+------------------------+---------------+------------+------------+--------------------------+
| pd.concat([l, r], | x y z | y | | Adds rows at the bottom. |
| axis=0, | a 1 2 . | 2 | | Uses 'outer' by default. |

6
index.html

@ -1188,7 +1188,7 @@ Hello World!
<li><strong>Only required methods are len() and getitem().</strong></li>
<li><strong>Getitem() should return an item at index or raise IndexError.</strong></li>
<li><strong>Iter() and contains() automatically work on any object that has getitem() defined.</strong></li>
<li><strong>Reversed() automatically works on any object that has getitem() and len() defined.</strong></li>
<li><strong>Reversed() automatically works on any object that has len() and getitem() defined.</strong></li>
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MySequence</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, a)</span>:</span>
self.a = a
@ -2734,8 +2734,8 @@ 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 <span class="hljs-string">'r'</span> is a series, it ┃
┃ │ c . . <span class="hljs-number">6</span> <span class="hljs-number">7</span> │ │ │ is first converted to DF.┃
┃ 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.
┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨
┃ 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. ┃

4
parse.js

@ -348,8 +348,8 @@ const DIAGRAM_15_B =
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
"┃ 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 ┃\n" +
"┃ │ c . . 6 7 │ │ │ is first converted to DF.┃\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" +
"┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\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" +

2
pdf/remove_links.py

@ -7,7 +7,7 @@ from pathlib import Path
MATCHES = {
'<strong>Module <a href="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as <a href="#lambda">lambda</a> expressions above.</strong>': '<strong>Module operator (p. 31) provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.</strong>',
'<strong>Module <a href="#operator">operator</a> provides functions itemgetter() and mul() that offer the same functionality as <a href="#lambda">lambda</a> expressions above.</strong>': '<strong>Module operator (p. 31) provides functions itemgetter() and mul() that offer the same functionality as lambda expressions (p. 11) above.</strong>',
'<strong><code class="python hljs"><span class="hljs-string">\'!r\'</span></code> calls object\'s <a href="#class">repr()</a> method, instead of <a href="#class">str()</a>, to get a string.</strong>': '<strong><code class="python hljs"><span class="hljs-string">\'!r\'</span></code> calls object\'s repr() method, instead of str(), to get a string (p. 14).</strong>',
'<strong>Default_factory can be any <a href="#callable">callable</a>.</strong>': '<strong>Default_factory can be any callable (p. 17).</strong>',
'<strong>Iterators returned by the <a href="#iterator">iter()</a> function, such as list_iterator and set_iterator.</strong>': '<strong>Iterators returned by the iter() function, such as list_iterator and set_iterator (p. 3).</strong>',

Loading…
Cancel
Save