You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto-generated via {sandpaper}
Source : 64fb4bf
Branch : main
Author : David Palmquist <[email protected]>
Time : 2024-02-05 16:28:33 +0000
Message : Merge pull request #584 from datacarpentry/improveExpandJoinsDiscussion
Update join types in pandas merge function
Copy file name to clipboardexpand all lines: 05-merging-data.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -434,16 +434,20 @@ case, `PF`) does not occur in `species_sub`.
434
434
435
435
### Other join types
436
436
437
-
The pandas `merge` function supports two other join types:
437
+
The pandas `merge` function supports other join types:
438
438
439
439
- Right (outer) join: Invoked by passing `how='right'` as an argument. Similar
440
440
to a left join, except *all* rows from the `right` DataFrame are kept, while
441
441
rows from the `left` DataFrame without matching join key(s) values are
442
442
discarded.
443
443
- Full (outer) join: Invoked by passing `how='outer'` as an argument. This join
444
-
type returns the all pairwise combinations of rows from both DataFrames; i.e.,
445
-
the result DataFrame will `NaN` where data is missing in one of the dataframes. This join type is
446
-
very rarely used.
444
+
type returns the all pairwise combinations of rows from both DataFrames; i.e., the
445
+
*Cartesian product* and the result DataFrame will use `NaN` where data is missing in one
446
+
of the dataframes. This join type is very rarely used, but can be helpful to see all
447
+
the qualities of both tables, including each common and duplicate column.
448
+
- Self-join: Joins a data frame with itself. Self-joins can be useful when you want to, for
449
+
instance, compare records within the same dataset based on a given criteria. A fuller discussion
450
+
of how and when it might be useful to do so can be found in [Self-Join and Cross Join in Pandas DataFrame](https://blog.devgenius.io/self-join-and-cross-join-in-pandas-dataframe-b30bfbc0e52a)
0 commit comments