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
Here's a description of what each argument is for:
497
497
@@ -522,6 +522,15 @@ Here's a description of what each argument is for:
522
522
cases but may improve performance / memory usage. The cases where copying
523
523
can be avoided are somewhat pathological but this option is provided
524
524
nonetheless.
525
+
- ``indicator``: Add a column to the output DataFrame called ``_merge``
526
+
with information on the source of each row. ``_merge`` is Categorical-type
527
+
and takes on a value of ``left_only`` for observations whose merge key
528
+
only appears in ``'left'`` DataFrame, ``right_only`` for observations whose
529
+
merge key only appears in ``'right'`` DataFrame, and ``both`` if the
530
+
observation's merge key is found in both.
531
+
532
+
.. versionadded:: 0.17.0
533
+
525
534
526
535
The return type will be the same as ``left``. If ``left`` is a ``DataFrame``
527
536
and ``right`` is a subclass of DataFrame, the return type will still be
@@ -667,6 +676,36 @@ either the left or right tables, the values in the joined table will be
667
676
labels=['left', 'right'], vertical=False);
668
677
plt.close('all');
669
678
679
+
.. _merging.indicator:
680
+
681
+
The merge indicator
682
+
~~~~~~~~~~~~~~~~~~~
683
+
684
+
.. versionadded:: 0.17.0
685
+
686
+
``merge`` now accepts the argument ``indicator``. If ``True``, a Categorical-type column called ``_merge`` will be added to the output object that takes on values:
The ``indicator`` argument will also accept string arguments, in which case the indicator function will use the value of the passed string as the name for the indicator column.
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.17.0.txt
+21
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,27 @@ Check the :ref:`API Changes <whatsnew_0170.api>` and :ref:`deprecations <whatsne
51
51
New features
52
52
~~~~~~~~~~~~
53
53
54
+
- ``merge`` now accepts the argument ``indicator`` which adds a Categorical-type column (by default called ``_merge``) to the output object that takes on the values:
0 commit comments