diff --git a/README.md b/README.md index 1721cb7..a55a17b 100644 --- a/README.md +++ b/README.md @@ -3129,7 +3129,7 @@ y 2 +-------------+-------------+-------------+---------------+ | | 'sum' | ['sum'] | {'s': 'sum'} | +-------------+-------------+-------------+---------------+ -| sr.apply(…) | 3 | sum 3 | s 3 | +| sr.apply(…) | 3 | sum 3 | s 3 | | sr.agg(…) | | | | +-------------+-------------+-------------+---------------+ ``` @@ -3139,11 +3139,11 @@ y 2 | | 'rank' | ['rank'] | {'r': 'rank'} | +-------------+-------------+-------------+---------------+ | sr.apply(…) | | rank | | -| sr.agg(…) | x 1 | x 1 | r x 1 | -| sr.trans(…) | y 2 | y 2 | y 2 | +| sr.agg(…) | x 1 | x 1 | r x 1 | +| sr.trans(…) | y 2 | y 2 | y 2 | +-------------+-------------+-------------+---------------+ ``` -* **Last result has a hierarchical index. Use `'[, ]'` to get the value.** +* **Last result has a hierarchical index. Use `'[key_1, key_2]'` to get its values.** ### DataFrame **Table with labeled rows and columns.** @@ -3248,9 +3248,9 @@ b 3 4 +-------------+-------------+-------------+---------------+ | | 'sum' | ['sum'] | {'x': 'sum'} | +-------------+-------------+-------------+---------------+ -| df.apply(…) | | x y | | -| df.agg(…) | x 4 | sum 4 6 | x 4 | -| | y 6 | | | +| df.apply(…) | | x y | | +| df.agg(…) | x 4 | sum 4 6 | x 4 | +| | y 6 | | | +-------------+-------------+-------------+---------------+ ``` @@ -3264,6 +3264,7 @@ b 3 4 | | | b 2 2 | | +-------------+-------------+-------------+---------------+ ``` +* **Use `'[col_key_1, col_key_2][row_key]'` to get the fifth result's values.** #### Encode, Decode: ```python diff --git a/index.html b/index.html index 198fde6..808b93b 100644 --- a/index.html +++ b/index.html @@ -2668,7 +2668,7 @@ y 2
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
 ┃             │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃
 ┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ sr.apply(…) │      3      │    sum 3    │     s  3      ┃
+┃ sr.apply(…) │      3      │    sum  3   │     s  3      ┃
 ┃ sr.agg(…)   │             │             │               ┃
 ┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
@@ -2676,12 +2676,12 @@ y 2 ┃ │ 'rank' │ ['rank'] │ {'r': 'rank'} ┃ ┠─────────────┼─────────────┼─────────────┼───────────────┨ ┃ sr.apply(…) │ │ rank │ ┃ -┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃ -┃ sr.trans(…) │ y 2 │ y 2 │ y 2 ┃ +┃ sr.agg(…) │ x 1 │ x 1 │ r x 1 ┃ +┃ sr.trans(…) │ y 2 │ y 2 │ y 2 ┃ ┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
    -
  • Last result has a hierarchical index. Use '<Sr>[<key_1>, <key_2>]' to get the value.
  • +
  • Last result has a hierarchical index. Use '<Sr>[key_1, key_2]' to get its values.

DataFrame

Table with labeled rows and columns.

>>> DataFrame([[1, 2], [3, 4]], index=['a', 'b'], columns=['x', 'y'])
    x  y
@@ -2766,9 +2766,9 @@ b  3  4
 
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
 ┃             │    'sum'    │   ['sum']   │ {'x': 'sum'}  ┃
 ┠─────────────┼─────────────┼─────────────┼───────────────┨
-┃ df.apply(…) │             │       x y   │               ┃
-┃ df.agg(…)   │    x  4     │   sum 4 6   │     x  4      ┃
-┃             │    y  6     │             │               ┃
+┃ df.apply(…) │             │       x  y  │               ┃
+┃ df.agg(…)   │     x  4    │  sum  4  6  │     x  4      ┃
+┃             │     y  6    │             │               ┃
 ┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓
@@ -2780,6 +2780,9 @@ b  3  4
 ┃             │             │ b    2    2 │               ┃
 ┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛
 
+
    +
  • Use '<DF>[col_key_1, col_key_2][row_key]' to get the fifth result's values.
  • +

Encode, Decode:

<DF> = pd.read_json/html('<str/path/url>')
 <DF> = pd.read_csv/pickle/excel('<path/url>')
 <DF> = pd.read_sql('<query>', <connection>)
diff --git a/parse.js b/parse.js
index 86eaedd..7bbb41d 100755
--- a/parse.js
+++ b/parse.js
@@ -275,13 +275,13 @@ const DIAGRAM_12_B =
   '┗━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━━━━┛\n';
 
 const DIAGRAM_13_A =
-  '| sr.apply(…) |      3      |    sum 3    |     s  3      |';
+  '| sr.apply(…) |      3      |    sum  3   |     s  3      |';
 
 const DIAGRAM_13_B =
   "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
   "┃             │    'sum'    │   ['sum']   │ {'s': 'sum'}  ┃\n" +
   "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" +
-  "┃ sr.apply(…) │      3      │    sum 3    │     s  3      ┃\n" +
+  "┃ sr.apply(…) │      3      │    sum  3   │     s  3      ┃\n" +
   "┃ sr.agg(…)   │             │             │               ┃\n" +
   "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n";
 
@@ -293,8 +293,8 @@ const DIAGRAM_14_B =
   "┃             │    'rank'   │   ['rank']  │ {'r': 'rank'} ┃\n" +
   "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" +
   "┃ sr.apply(…) │             │      rank   │               ┃\n" +
-  "┃ sr.agg(…)   │    x  1     │   x     1   │    r  x  1    ┃\n" +
-  "┃ sr.trans(…) │    y  2     │   y     2   │       y  2    ┃\n" +
+  "┃ sr.agg(…)   │     x  1    │   x     1   │    r  x  1    ┃\n" +
+  "┃ sr.trans(…) │     y  2    │   y     2   │       y  2    ┃\n" +
   "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n";
 
 const DIAGRAM_15_A = 
@@ -332,15 +332,15 @@ const DIAGRAM_15_B =
   "┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n";
 
 const DIAGRAM_16_A =
-  '| df.apply(…) |             |       x y   |               |';
+  '| df.apply(…) |             |       x  y  |               |';
 
 const DIAGRAM_16_B =
   "┏━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┓\n" +
   "┃             │    'sum'    │   ['sum']   │ {'x': 'sum'}  ┃\n" +
   "┠─────────────┼─────────────┼─────────────┼───────────────┨\n" +
-  "┃ df.apply(…) │             │       x y   │               ┃\n" +
-  "┃ df.agg(…)   │    x  4     │   sum 4 6   │     x  4      ┃\n" +
-  "┃             │    y  6     │             │               ┃\n" +
+  "┃ df.apply(…) │             │       x  y  │               ┃\n" +
+  "┃ df.agg(…)   │     x  4    │  sum  4  6  │     x  4      ┃\n" +
+  "┃             │     y  6    │             │               ┃\n" +
   "┗━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┛\n";
 
 const DIAGRAM_17_A =