From f36224c12a0cbd1ef2968285c39050329dcebe35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 17 Dec 2019 12:41:48 +0100 Subject: [PATCH] Small fixes --- README.md | 38 +++++++++++++++++++------------------- index.html | 38 +++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 0341d30..d39c034 100644 --- a/README.md +++ b/README.md @@ -379,9 +379,9 @@ import re * **By default digits, whitespaces and alphanumerics from all alphabets are matched, unless `'flags=re.ASCII'` argument is used.** * **Use capital letter for negation.** ```python -'\d' == '[0-9]' # Digit -'\s' == '[ \t\n\r\f\v]' # Whitespace -'\w' == '[a-zA-Z0-9_]' # Alphanumeric +'\d' == '[0-9]' # Matches any digit. +'\s' == '[ \t\n\r\f\v]' # Matches any whitespace. +'\w' == '[a-zA-Z0-9_]' # Matches any alphanumeric. ``` @@ -1303,11 +1303,11 @@ class (Enum): * **Otherwise it returns an increment of the last numeric value.** ```python - = . # Returns a member. - = [''] # Returns a member or raises KeyError. - = () # Returns a member or raises ValueError. -name = .name -value = .value + = . # Returns a member. + = [''] # Returns a member or raises KeyError. + = () # Returns a member or raises ValueError. + = .name # Returns member's name. + = .value # Returns member's value. ``` ```python @@ -2094,9 +2094,9 @@ Introspection ### Variables ```python - = dir() # Names of variables in current scope. - = locals() # Dict of local variables. Also vars(). - = globals() # Dict of global variables. + = dir() # Returns names of variables in current scope. + = locals() # Returns dict of local variables. Also vars(). + = globals() # Returns dict of global variables. ``` ### Attributes @@ -2168,8 +2168,8 @@ class MyClass(metaclass=MyMetaClass): ### Type Diagram ```python -type(MyClass) == MyMetaClass # MyClass is an instance of MyMetaClass. -type(MyMetaClass) == type # MyMetaClass is an instance of type. +type(MyClass) == MyMetaClass # MyClass is an instance of MyMetaClass. +type(MyMetaClass) == type # MyMetaClass is an instance of type. ``` ```text @@ -2186,8 +2186,8 @@ type(MyMetaClass) == type # MyMetaClass is an instance of type. ### Inheritance Diagram ```python -MyClass.__base__ == object # MyClass is a subclass of object. -MyMetaClass.__base__ == type # MyMetaClass is a subclass of type. +MyClass.__base__ == object # MyClass is a subclass of object. +MyMetaClass.__base__ == type # MyMetaClass is a subclass of type. ``` ```text @@ -2575,14 +2575,14 @@ indexes = .argmin(axis) **Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.** ```python -left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) -right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3) +left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) +right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3) ``` #### 1. If array shapes differ in length, left-pad the shorter shape with ones: ```python -left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) -right = [[0.1 , 0.6 , 0.8]] # Shape: (1, 3) <- ! +left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) +right = [[0.1 , 0.6 , 0.8]] # Shape: (1, 3) <- ! ``` #### 2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements: diff --git a/index.html b/index.html index 0b27754..aa5b611 100644 --- a/index.html +++ b/index.html @@ -483,9 +483,9 @@ to_exclusive = <range>.stop

Special Sequences

  • By default digits, whitespaces and alphanumerics from all alphabets are matched, unless 'flags=re.ASCII' argument is used.
  • Use capital letter for negation.
  • -
'\d' == '[0-9]'                                # Digit
-'\s' == '[ \t\n\r\f\v]'                        # Whitespace
-'\w' == '[a-zA-Z0-9_]'                         # Alphanumeric
+
'\d' == '[0-9]'                                # Matches any digit.
+'\s' == '[ \t\n\r\f\v]'                        # Matches any whitespace.
+'\w' == '[a-zA-Z0-9_]'                         # Matches any alphanumeric.
 
@@ -1232,11 +1232,11 @@ Hello World!
  • If there are no numeric values before auto(), it returns 1.
  • Otherwise it returns an increment of the last numeric value.
  • -
    <member> = <enum>.<member_name>                 # Returns a member.
    -<member> = <enum>['<member_name>']              # Returns a member or raises KeyError.
    -<member> = <enum>(<value>)                      # Returns a member or raises ValueError.
    -name     = <member>.name
    -value    = <member>.value
    +
    <member> = <enum>.<member_name>                # Returns a member.
    +<member> = <enum>['<member_name>']             # Returns a member or raises KeyError.
    +<member> = <enum>(<value>)                     # Returns a member or raises ValueError.
    +<str>    = <member>.name                       # Returns member's name.
    +<obj>    = <member>.value                      # Returns member's value.
     
    list_of_members = list(<enum>)
     member_names    = [a.name for a in <enum>]
    @@ -1831,9 +1831,9 @@ product_of_elems = functools.reduce(op.mul, <collection>)
     LogicOp          = enum.Enum('LogicOp', {'AND': op.and_, 'OR' : op.or_})
     last_el          = op.methodcaller('pop')(<list>)
     
    -

    #Introspection

    Inspecting code at runtime.

    Variables

    <list> = dir()      # Names of variables in current scope.
    -<dict> = locals()   # Dict of local variables. Also vars().
    -<dict> = globals()  # Dict of global variables.
    +

    #Introspection

    Inspecting code at runtime.

    Variables

    <list> = dir()                       # Returns names of variables in current scope.
    +<dict> = locals()                    # Returns dict of local variables. Also vars().
    +<dict> = globals()                   # Returns dict of global variables.
     
    @@ -1884,8 +1884,8 @@ param_names = list(<sig>.parameters.keys())
    >>> MyClass.a, MyClass.b
     ('abcde', 12345)
     
    -

    Type Diagram

    type(MyClass)     == MyMetaClass  # MyClass is an instance of MyMetaClass.
    -type(MyMetaClass) == type         # MyMetaClass is an instance of type.
    +

    Type Diagram

    type(MyClass)     == MyMetaClass     # MyClass is an instance of MyMetaClass.
    +type(MyMetaClass) == type            # MyMetaClass is an instance of type.
     
    +-------------+-------------+
    @@ -1898,8 +1898,8 @@ type(MyMetaClass) == type         # MyMetaClass is an
     |     str ---------+        |
     +-------------+-------------+
     
    -

    Inheritance Diagram

    MyClass.__base__     == object    # MyClass is a subclass of object.
    -MyMetaClass.__base__ == type      # MyMetaClass is a subclass of type.
    +

    Inheritance Diagram

    MyClass.__base__     == object       # MyClass is a subclass of object.
    +MyMetaClass.__base__ == type         # MyMetaClass is a subclass of type.
     
    +-------------+-------------+
    @@ -2197,13 +2197,13 @@ indexes = <array>.argmin(axis)
     
    • If row and column indexes differ in shape, they are combined with broadcasting.
    -

    Broadcasting

    Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.

    left  = [[0.1], [0.6], [0.8]]  # Shape: (3, 1)
    -right = [ 0.1 ,  0.6 ,  0.8 ]  # Shape: (3)
    +

    Broadcasting

    Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.

    left  = [[0.1], [0.6], [0.8]]        # Shape: (3, 1)
    +right = [ 0.1 ,  0.6 ,  0.8 ]        # Shape: (3)
     
    -

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

    left  = [[0.1], [0.6], [0.8]]  # Shape: (3, 1)
    -right = [[0.1 ,  0.6 ,  0.8]]  # Shape: (1, 3) <- !
    +

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

    left  = [[0.1], [0.6], [0.8]]        # Shape: (3, 1)
    +right = [[0.1 ,  0.6 ,  0.8]]        # Shape: (1, 3) <- !
     

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

    left  = [[0.1, 0.1, 0.1], [0.6, 0.6, 0.6], [0.8, 0.8, 0.8]]  # Shape: (3, 3) <- !