Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Edits to rst
GH21220
  • Loading branch information
KalyanGokhale committed Jun 20, 2018
commit e896a917fecd5779d4a0a574747f667272684d46
33 changes: 16 additions & 17 deletions doc/source/merging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ You can also pass a list of dicts or Series:
.. _merging.join:

Database-style DataFrame joining/merging
----------------------------------------
Database-style DataFrame or named Series joining/merging
--------------------------------------------------------

pandas has full-featured, **high performance** in-memory join operations
idiomatically very similar to relational databases like SQL. These methods
Expand All @@ -522,7 +522,7 @@ Users who are familiar with SQL but new to pandas might be interested in a
:ref:`comparison with SQL<compare_with_sql.join>`.

pandas provides a single function, :func:`~pandas.merge`, as the entry point for
all standard database join operations between ``DataFrame`` objects:
all standard database join operations between ``DataFrame`` or named ``Series`` objects:

::

Expand All @@ -531,31 +531,31 @@ all standard database join operations between ``DataFrame`` objects:
suffixes=('_x', '_y'), copy=True, indicator=False,
validate=None)

* ``left``: A DataFrame object.
* ``right``: Another DataFrame object.
* ``left``: A DataFrame or named Series object.
* ``right``: Another DataFrame or named Series object.
* ``on``: Column or index level names to join on. Must be found in both the left
and right DataFrame objects. If not passed and ``left_index`` and
and right DataFrame and/or Series objects. If not passed and ``left_index`` and
``right_index`` are ``False``, the intersection of the columns in the
DataFrames will be inferred to be the join keys.
* ``left_on``: Columns or index levels from the left DataFrame to use as
DataFrames and/or Series will be inferred to be the join keys.
* ``left_on``: Columns or index levels from the left DataFrame or Series to use as
keys. Can either be column names, index level names, or arrays with length
equal to the length of the DataFrame.
* ``right_on``: Columns or index levels from the right DataFrame to use as
equal to the length of the DataFrame or Series.
* ``right_on``: Columns or index levels from the right DataFrame or Series to use as
keys. Can either be column names, index level names, or arrays with length
equal to the length of the DataFrame.
equal to the length of the DataFrame or Series.
* ``left_index``: If ``True``, use the index (row labels) from the left
DataFrame as its join key(s). In the case of a DataFrame with a MultiIndex
DataFrame or Series as its join key(s). In the case of a DataFrame or Series with a MultiIndex
(hierarchical), the number of levels must match the number of join keys
from the right DataFrame.
* ``right_index``: Same usage as ``left_index`` for the right DataFrame
from the right DataFrame or Series.
* ``right_index``: Same usage as ``left_index`` for the right DataFrame or Series
* ``how``: One of ``'left'``, ``'right'``, ``'outer'``, ``'inner'``. Defaults
to ``inner``. See below for more detailed description of each method.
* ``sort``: Sort the result DataFrame by the join keys in lexicographical
order. Defaults to ``True``, setting to ``False`` will improve performance
substantially in many cases.
* ``suffixes``: A tuple of string suffixes to apply to overlapping
columns. Defaults to ``('_x', '_y')``.
* ``copy``: Always copy data (default ``True``) from the passed DataFrame
* ``copy``: Always copy data (default ``True``) from the passed DataFrame or named Series
objects, even when reindexing is not necessary. Cannot be avoided in many
cases but may improve performance / memory usage. The cases where copying
can be avoided are somewhat pathological but this option is provided
Expand Down Expand Up @@ -587,8 +587,7 @@ all standard database join operations between ``DataFrame`` objects:
Support for merging named ``Series`` objects was added in version 0.24.0.

The return type will be the same as ``left``. If ``left`` is a ``DataFrame`` or named ``Series``
and ``right`` is a subclass of ``DataFrame``, the return type will still be
``DataFrame``.
and ``right`` is a subclass of ``DataFrame``, the return type will still be ``DataFrame``.

``merge`` is a function in the pandas namespace, and it is also available as a
``DataFrame`` instance method :meth:`~DataFrame.merge`, with the calling
Expand Down