Skip to content

Commit 0bed787

Browse files
committed
Add docs
1 parent f2613c3 commit 0bed787

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

doc/source/user_guide/merging.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,18 @@ either the left or right tables, the values in the joined table will be
473473
p.plot([left, right], result, labels=["left", "right"], vertical=False);
474474
plt.close("all");
475475
476+
.. ipython:: python
477+
478+
result = pd.merge(left, right, how="left_semi", on=["key1", "key2"])
479+
result
480+
481+
.. ipython:: python
482+
:suppress:
483+
484+
@savefig merging_merge_on_key_inner.png
485+
p.plot([left, right], result, labels=["left", "right"], vertical=False);
486+
plt.close("all");
487+
476488
.. ipython:: python
477489
478490
result = pd.merge(left, right, how="cross")

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
* inner: use intersection of keys from both frames, similar to a SQL inner
340340
join; preserve the order of the left keys.
341341
* left_semi: Filter for rows in the left that have a match on the right;
342-
preserve the order of the left keys.
342+
preserve the order of the left keys, similar to SQL left semi join.
343343
344344
.. versionadded:: 3.0
345345
* cross: creates the cartesian product from both frames, preserves the order

0 commit comments

Comments
 (0)