diff --git a/README.md b/README.md index 83e691d..bdf5dbc 100644 --- a/README.md +++ b/README.md @@ -1397,7 +1397,8 @@ finally: ``` * **Code inside the `'else'` block will only be executed if `'try'` block had no exceptions.** * **Code inside the `'finally'` block will always be executed (unless a signal is received).** -* **All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try/except clause (only function block delimits scope).** +* **All variables that are initialized in executed blocks are also visible in all subsequent blocks +, as well as outside the try statement (only function block delimits scope).** * **To catch signals use `'signal.signal(signal_number, )'`.** ### Catching Exceptions @@ -3155,14 +3156,14 @@ Name: a, dtype: int64 ``` ```python - = .loc[key] # Or: .iloc[index] - = .loc[keys] # Or: .iloc[indexes] - = .loc[from_key : to_key_inclusive] # Or: .iloc[from_i : to_i_exclusive] + = .loc[key] # Or: .iloc[i] + = .loc[keys] # Or: .iloc[coll_of_i] + = .loc[from_key:to_key_inc] # Or: .iloc[from_i:to_i_exc] ``` ```python - = [key/index] # Or: .key - = [keys/indexes] # Or: [] + = [key/i] # Or: . + = [keys/coll_of_i] # Or: [key/i : key/i] = [bools] # Or: .loc/iloc[bools] ``` @@ -3213,7 +3214,7 @@ y 3 | | y 2 | y 2 | y 2 | +---------------+-------------+-------------+---------------+ ``` -* **Keys/indexes/bools can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!** +* **Keys/indices/bools can't be tuples because `'obj[x, y]'` is converted to `'obj[(x, y)]'`!** * **Methods ffill(), interpolate(), fillna() and dropna() accept `'inplace=True'`.** * **Last result has a hierarchical index. Use `'[key_1, key_2]'` to get its values.** @@ -3233,14 +3234,14 @@ b 3 4 ``` ```python - = .loc[row_key, column_key] # Or: .iloc[row_index, column_index] - = .loc[row_key/s] # Or: .iloc[row_index/es] - = .loc[:, column_key/s] # Or: .iloc[:, column_index/es] - = .loc[row_bools, column_bools] # Or: .iloc[row_bools, column_bools] + = .loc[row_key, col_key] # Or: .iloc[row_i, col_i] + = .loc[row_key/s] # Or: .iloc[row_i/s] + = .loc[:, col_key/s] # Or: .iloc[:, col_i/s] + = .loc[row_bools, col_bools] # Or: .iloc[row_bools, col_bools] ``` ```python - = [column_key/s] # Or: .column_key + = [col_key/s] # Or: . = [row_bools] # Keeps rows as specified by bools. = [] # Assigns NaN to items that are False in bools. ``` @@ -3251,10 +3252,10 @@ b 3 4 ``` ```python - = .set_index(column_key) # Replaces row keys with values from the column. + = .set_index(col_key) # Replaces row keys with column's values. = .reset_index(drop=False) # Drops or moves row keys to column named index. = .sort_index(ascending=True) # Sorts rows by row keys. Use `axis=1` for cols. - = .sort_values(column_key/s) # Sorts rows by passed column/s. Also `axis=1`. + = .sort_values(col_key/s) # Sorts rows by passed column/s. Also `axis=1`. ``` #### DataFrame — Merge, Join, Concat: diff --git a/index.html b/index.html index cc374a3..d355a87 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -1190,7 +1190,8 @@ LogicOp = Enum('LogicOp', {'else' block will only be executed if 'try' block had no exceptions.
  • Code inside the 'finally' block will always be executed (unless a signal is received).
  • -
  • All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try/except clause (only function block delimits scope).
  • +
  • All variables that are initialized in executed blocks are also visible in all subsequent blocks +, as well as outside the try statement (only function block delimits scope).
  • To catch signals use 'signal.signal(signal_number, <func>)'.
  • Catching Exceptions

    except <exception>: ...
    @@ -2587,12 +2588,12 @@ Name: a, dtype: int64
     <Sr> = pd.Series(<dict>)                       # Takes dictionary's keys for index.
     <Sr> = pd.Series(<dict/Series>, index=<list>)  # Only keeps items with keys specified in index.
     
    -
    <el> = <Sr>.loc[key]                           # Or: <Sr>.iloc[index]
    -<Sr> = <Sr>.loc[keys]                          # Or: <Sr>.iloc[indexes]
    -<Sr> = <Sr>.loc[from_key : to_key_inclusive]   # Or: <Sr>.iloc[from_i : to_i_exclusive]
    +
    <el> = <Sr>.loc[key]                           # Or: <Sr>.iloc[i]
    +<Sr> = <Sr>.loc[keys]                          # Or: <Sr>.iloc[coll_of_i]
    +<Sr> = <Sr>.loc[from_key:to_key_inc]           # Or: <Sr>.iloc[from_i:to_i_exc]
     
    -
    <el> = <Sr>[key/index]                         # Or: <Sr>.key
    -<Sr> = <Sr>[keys/indexes]                      # Or: <Sr>[<keys_slice/slice>]
    +
    <el> = <Sr>[key/i]                             # Or: <Sr>.<key>
    +<Sr> = <Sr>[keys/coll_of_i]                    # Or: <Sr>[key/i : key/i]
     <Sr> = <Sr>[bools]                             # Or: <Sr>.loc/iloc[bools]
     
    <Sr> = <Sr> > <el/Sr>                          # Returns a Series of bools.
    @@ -2631,7 +2632,7 @@ y    3
     
      -
    • Keys/indexes/bools can't be tuples because 'obj[x, y]' is converted to 'obj[(x, y)]'!
    • +
    • Keys/indices/bools can't be tuples because 'obj[x, y]' is converted to 'obj[(x, y)]'!
    • Methods ffill(), interpolate(), fillna() and dropna() accept 'inplace=True'.
    • Last result has a hierarchical index. Use '<Sr>[key_1, key_2]' to get its values.
    @@ -2645,22 +2646,22 @@ b 3 4
    <DF>    = pd.DataFrame(<list_of_rows>)         # Rows can be either lists, dicts or series.
     <DF>    = pd.DataFrame(<dict_of_columns>)      # Columns can be either lists, dicts or series.
     
    -
    <el>    = <DF>.loc[row_key, column_key]        # Or: <DF>.iloc[row_index, column_index]
    -<Sr/DF> = <DF>.loc[row_key/s]                  # Or: <DF>.iloc[row_index/es]
    -<Sr/DF> = <DF>.loc[:, column_key/s]            # Or: <DF>.iloc[:, column_index/es]
    -<DF>    = <DF>.loc[row_bools, column_bools]    # Or: <DF>.iloc[row_bools, column_bools]
    +
    <el>    = <DF>.loc[row_key, col_key]           # Or: <DF>.iloc[row_i, col_i]
    +<Sr/DF> = <DF>.loc[row_key/s]                  # Or: <DF>.iloc[row_i/s]
    +<Sr/DF> = <DF>.loc[:, col_key/s]               # Or: <DF>.iloc[:, col_i/s]
    +<DF>    = <DF>.loc[row_bools, col_bools]       # Or: <DF>.iloc[row_bools, col_bools]
     
    -
    <Sr/DF> = <DF>[column_key/s]                   # Or: <DF>.column_key
    +
    <Sr/DF> = <DF>[col_key/s]                      # Or: <DF>.<col_key>
     <DF>    = <DF>[row_bools]                      # Keeps rows as specified by bools.
     <DF>    = <DF>[<DF_of_bools>]                  # Assigns NaN to items that are False in bools.
     
    <DF>    = <DF> > <el/Sr/DF>                    # Returns DF of bools. Sr is treated as a row.
     <DF>    = <DF> + <el/Sr/DF>                    # Items with non-matching keys get value NaN.
     
    -
    <DF>    = <DF>.set_index(column_key)           # Replaces row keys with values from the column.
    +
    <DF>    = <DF>.set_index(col_key)              # Replaces row keys with column's values.
     <DF>    = <DF>.reset_index(drop=False)         # Drops or moves row keys to column named index.
     <DF>    = <DF>.sort_index(ascending=True)      # Sorts rows by row keys. Use `axis=1` for cols.
    -<DF>    = <DF>.sort_values(column_key/s)       # Sorts rows by passed column/s. Also `axis=1`.
    +<DF>    = <DF>.sort_values(col_key/s)          # Sorts rows by passed column/s. Also `axis=1`.
     

    DataFrame — Merge, Join, Concat:

    >>> l = pd.DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y'])
        x  y
    @@ -2932,7 +2933,7 @@ $ deactivate                  # Deactivates the activ