diff --git a/README.md b/README.md index b1cf2d2..114b455 100644 --- a/README.md +++ b/README.md @@ -1164,7 +1164,7 @@ class MySortable: ### Iterator * **Any object that has methods next() and iter() is an iterator.** * **Next() should return next item or raise StopIteration exception.** -* **Iter() should return 'self'.** +* **Iter() should return 'self', i.e. unmodified object on which it was called.** ```python class Counter: def __init__(self): @@ -2718,14 +2718,14 @@ import numpy as np ### Broadcasting **A set of rules by which NumPy functions operate on arrays of different shapes.** ```python -left = np.array([ 0.1, 0.6, 0.8 ]) # `left.shape == (3,)` -right = np.array([[0.1],[0.6],[0.8]]) # `right.shape == (3, 1)` +left = np.array([0.1, 0.6, 0.8]) # `left.shape == (3,)` +right = np.array([[0.1], [0.6], [0.8]]) # `right.shape == (3, 1)` ``` #### 1. If array shapes differ in length, left-pad the shorter shape with ones: ```python left = np.array([[0.1, 0.6, 0.8]]) # `left.shape == (1, 3)` -right = np.array([[0.1],[0.6],[0.8]]) # `right.shape == (3, 1)` +right = np.array([[0.1], [0.6], [0.8]]) # `right.shape == (3, 1)` ``` #### 2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements: @@ -3525,7 +3525,7 @@ Appendix ```python # $ pip3 install cython import pyximport; pyximport.install() # Module that runs imported Cython scripts. -import # Script's filename needs a '.pyx' extension. +import # Script must be saved with '.pyx' extension. .main() # Main() isn't automatically executed. ``` diff --git a/index.html b/index.html index 7084bbf..e9492d1 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
- +
@@ -978,7 +978,7 @@ Point = make_dataclass('Point', [(Iterator
  • Any object that has methods next() and iter() is an iterator.
  • Next() should return next item or raise StopIteration exception.
  • -
  • Iter() should return 'self'.
  • +
  • Iter() should return 'self', i.e. unmodified object on which it was called.
class Counter:
     def __init__(self):
         self.i = 0
@@ -2216,13 +2216,13 @@ $ snakeviz test.prof                                            'ix_([1, 2], [3, 4])' returns '[[1], [2]]' and '[[3, 4]]'. Due to broadcasting rules, this is the same as using '[[1, 1], [2, 2]]' and '[[3, 4], [3, 4]]'.
 
  • Any value that is broadcastable to the indexed shape can be assigned to the selection.
  • -

    Broadcasting

    A set of rules by which NumPy functions operate on arrays of different shapes.

    left  = np.array([ 0.1,  0.6,  0.8 ])                   # `left.shape  == (3,)`
    -right = np.array([[0.1],[0.6],[0.8]])                   # `right.shape == (3, 1)`
    +

    Broadcasting

    A set of rules by which NumPy functions operate on arrays of different shapes.

    left  = np.array([0.1,  0.6,  0.8])                     # `left.shape  == (3,)`
    +right = np.array([[0.1], [0.6], [0.8]])                 # `right.shape == (3, 1)`
     

    1. If array shapes differ in length, left-pad the shorter shape with ones:

    left  = np.array([[0.1,  0.6,  0.8]])                   # `left.shape  == (1, 3)`
    -right = np.array([[0.1],[0.6],[0.8]])                   # `right.shape == (3, 1)`
    +right = np.array([[0.1], [0.6], [0.8]])                 # `right.shape == (3, 1)`
     

    2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements:

    left  = np.array([[0.1,  0.6,  0.8],                    # `left.shape  == (3, 3)`
    @@ -2868,7 +2868,7 @@ px.line(df, x='Date', y=#Appendix

    Cython

    Library that compiles Python-like code into C.

    # $ pip3 install cython
     import pyximport; pyximport.install()  # Module that runs imported Cython scripts.
    -import <cython_script>                 # Script's filename needs a '.pyx' extension.
    +import <cython_script>                 # Script must be saved with '.pyx' extension.
     <cython_script>.main()                 # Main() isn't automatically executed.
     
    @@ -2934,7 +2934,7 @@ $ deactivate # Deactivates the active