From 4c18e178ffd357bc1f995ed9a79fedd87298f906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 3 Dec 2020 19:57:13 +0100 Subject: [PATCH] Duck types, Pandas --- README.md | 6 +++--- index.html | 6 +++--- parse.js | 4 ++-- pdf/remove_links.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5653530..c8a8b1f 100644 --- a/README.md +++ b/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. | diff --git a/index.html b/index.html index b4adce7..57e75e9 100644 --- a/index.html +++ b/index.html @@ -1188,7 +1188,7 @@ Hello World!
  • 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.
  • class MySequence:
         def __init__(self, a):
             self.a = a
    @@ -2734,8 +2734,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  53  4  4  53  4  4  5 │ If 'r' is a series, it   ┃
    -┃                        │ c  .  .  6  7 │            │            │ is first converted to DF.┃
    +┃           how=…)       │ b  3  4  4  53  4  4  53  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. ┃
    diff --git a/parse.js b/parse.js
    index 0bdaf67..c23c909 100755
    --- a/parse.js
    +++ b/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" +
    diff --git a/pdf/remove_links.py b/pdf/remove_links.py
    index 74d0a22..36c27b6 100755
    --- a/pdf/remove_links.py
    +++ b/pdf/remove_links.py
    @@ -7,7 +7,7 @@ from pathlib import Path
     
     
     MATCHES = {
    -    'Module operator provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.': 'Module operator (p. 31) provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.',
    +    'Module operator provides functions itemgetter() and mul() that offer the same functionality as lambda expressions above.': 'Module operator (p. 31) provides functions itemgetter() and mul() that offer the same functionality as lambda expressions (p. 11) above.',
         '\'!r\' calls object\'s repr() method, instead of str(), to get a string.': '\'!r\' calls object\'s repr() method, instead of str(), to get a string (p. 14).',
         'Default_factory can be any callable.': 'Default_factory can be any callable (p. 17).',
         'Iterators returned by the iter() function, such as list_iterator and set_iterator.': 'Iterators returned by the iter() function, such as list_iterator and set_iterator (p. 3).',