diff --git a/README.md b/README.md index e540c19..e2f348c 100644 --- a/README.md +++ b/README.md @@ -3209,23 +3209,23 @@ 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 is | -| | c . . 6 7 | | | first converted to DF. | +| | c . . 6 7 | | | treated as a column. | +------------------------+---------------+------------+------------+--------------------------+ | pd.concat([l, r], | x y z | y | | Adds rows at the bottom. | | axis=0, | a 1 2 . | 2 | | Uses 'outer' by default. | -| join=…) | b 3 4 . | 4 | | By default works the | -| | b . 4 5 | 4 | | same as `l.append(r)`. | -| | c . 6 7 | 6 | | | +| join=…) | b 3 4 . | 4 | | A series is treated as a | +| | b . 4 5 | 4 | | column. Use l.append(r) | +| | c . 6 7 | 6 | | to add a row instead. | +------------------------+---------------+------------+------------+--------------------------+ | pd.concat([l, r], | x y y z | | | Adds columns at the | -| axis=1, | a 1 2 . . | x y y z | | right end. | -| join=…) | b 3 4 4 5 | 3 4 4 5 | | Uses 'outer' by default. | -| | c . . 6 7 | | | | +| axis=1, | a 1 2 . . | x y y z | | right end. Uses 'outer' | +| join=…) | b 3 4 4 5 | 3 4 4 5 | | by default. A series is | +| | c . . 6 7 | | | treated as a column. | +------------------------+---------------+------------+------------+--------------------------+ | l.combine_first(r) | x y z | | | Adds missing rows and | -| | a 1 2 . | | | columns. | -| | b 3 4 5 | | | | -| | c . 6 7 | | | | +| | a 1 2 . | | | columns. Also updates | +| | b 3 4 5 | | | cells that contain NaN. | +| | c . 6 7 | | | R must be a DataFrame. | +------------------------+---------------+------------+------------+--------------------------+ ``` diff --git a/index.html b/index.html index 0252554..1cf9f92 100644 --- a/index.html +++ b/index.html @@ -2746,23 +2746,23 @@ 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 is ┃ -┃ │ c . . 6 7 │ │ │ first converted to DF. ┃ +┃ │ c . . 6 7 │ │ │ treated as a column. ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃ ┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃ -┃ join=…) │ b 3 4 . │ 4 │ │ By default works the ┃ -┃ │ b . 4 54 │ │ same as `l.append(r)`. ┃ -┃ │ c . 6 76 │ │ ┃ +┃ join=…) │ b 3 4 . │ 4 │ │ A series is treated as a ┃ +┃ │ b . 4 54 │ │ column. Use l.append(r) ┃ +┃ │ c . 6 76 │ │ to add a row instead. ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃ -┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. ┃ -┃ join=…) │ b 3 4 4 53 4 4 5 │ │ Uses 'outer' by default. ┃ -┃ │ c . . 6 7 │ │ │ ┃ +┃ axis=1, │ a 1 2 . . │ x y y z │ │ right end. Uses 'outer' ┃ +┃ join=…) │ b 3 4 4 53 4 4 5 │ │ by default. A series is ┃ +┃ │ c . . 6 7 │ │ │ treated as a column. ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃ -┃ │ a 1 2 . │ │ │ columns. ┃ -┃ │ b 3 4 5 │ │ │ ┃ -┃ │ c . 6 7 │ │ │ ┃ +┃ │ a 1 2 . │ │ │ columns. Also updates ┃ +┃ │ b 3 4 5 │ │ │ cells that contain NaN. ┃ +┃ │ c . 6 7 │ │ │ R must be a DataFrame. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Aggregate, Transform, Map:

<Sr> = <DF>.sum/max/mean/idxmax/all()         # Or: <DF>.apply/agg/transform(<agg_func>)
diff --git a/parse.js b/parse.js
index 458c3ec..e1acf8c 100755
--- a/parse.js
+++ b/parse.js
@@ -347,23 +347,23 @@ const DIAGRAM_15_B =
   "┃ 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 is  ┃\n" +
-  "┃                        │ c  .  .  6  7 │            │            │ first converted to DF.   ┃\n" +
+  "┃                        │ c  .  .  6  7 │            │            │ treated as a column.     ┃\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" +
-  "┃           join=…)      │ b  3   4   .  │     4      │            │ By default works the     ┃\n" +
-  "┃                        │ b  .   4   5  │     4      │            │ same as `l.append(r)`.   ┃\n" +
-  "┃                        │ c  .   6   7  │     6      │            │                          ┃\n" +
+  "┃           join=…)      │ b  3   4   .  │     4      │            │ A series is treated as a ┃\n" +
+  "┃                        │ b  .   4   5  │     4      │            │ column. Use l.append(r)  ┃\n" +
+  "┃                        │ c  .   6   7  │     6      │            │ to add a row instead.    ┃\n" +
   "┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
   "┃ pd.concat([l, r],      │    x  y  y  z │            │            │ Adds columns at the      ┃\n" +
-  "┃           axis=1,      │ a  1  2  .  . │ x  y  y  z │            │ right end.               ┃\n" +
-  "┃           join=…)      │ b  3  4  4  5 │ 3  4  4  5 │            │ Uses 'outer' by default. ┃\n" +
-  "┃                        │ c  .  .  6  7 │            │            │                          ┃\n" +
+  "┃           axis=1,      │ a  1  2  .  . │ x  y  y  z │            │ right end. Uses 'outer'  ┃\n" +
+  "┃           join=…)      │ b  3  4  4  5 │ 3  4  4  5 │            │ by default. A series is  ┃\n" +
+  "┃                        │ c  .  .  6  7 │            │            │ treated as a column.     ┃\n" +
   "┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨\n" +
   "┃ l.combine_first(r)     │    x   y   z  │            │            │ Adds missing rows and    ┃\n" +
-  "┃                        │ a  1   2   .  │            │            │ columns.                 ┃\n" +
-  "┃                        │ b  3   4   5  │            │            │                          ┃\n" +
-  "┃                        │ c  .   6   7  │            │            │                          ┃\n" +
+  "┃                        │ a  1   2   .  │            │            │ columns. Also updates    ┃\n" +
+  "┃                        │ b  3   4   5  │            │            │ cells that contain NaN.  ┃\n" +
+  "┃                        │ c  .   6   7  │            │            │ R must be a DataFrame.   ┃\n" +
   "┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n";
 
 const DIAGRAM_16_A =