@@ -506,8 +506,8 @@ You can also pass a list of dicts or Series:
506506
507507 .. _merging.join :
508508
509- Database-style DataFrame joining/merging
510- ----------------------------------------
509+ Database-style DataFrame or named Series joining/merging
510+ --------------------------------------------------------
511511
512512pandas has full-featured, **high performance ** in-memory join operations
513513idiomatically very similar to relational databases like SQL. These methods
@@ -522,7 +522,7 @@ Users who are familiar with SQL but new to pandas might be interested in a
522522:ref: `comparison with SQL<compare_with_sql.join> `.
523523
524524pandas provides a single function, :func: `~pandas.merge `, as the entry point for
525- all standard database join operations between ``DataFrame `` objects:
525+ all standard database join operations between ``DataFrame `` or named `` Series `` objects:
526526
527527::
528528
@@ -531,40 +531,40 @@ all standard database join operations between ``DataFrame`` objects:
531531 suffixes=('_x', '_y'), copy=True, indicator=False,
532532 validate=None)
533533
534- * ``left ``: A DataFrame object.
535- * ``right ``: Another DataFrame object.
534+ * ``left ``: A DataFrame or named Series object.
535+ * ``right ``: Another DataFrame or named Series object.
536536* ``on ``: Column or index level names to join on. Must be found in both the left
537- and right DataFrame objects. If not passed and ``left_index `` and
537+ and right DataFrame and/or Series objects. If not passed and ``left_index `` and
538538 ``right_index `` are ``False ``, the intersection of the columns in the
539- DataFrames will be inferred to be the join keys.
540- * ``left_on ``: Columns or index levels from the left DataFrame to use as
539+ DataFrames and/or Series will be inferred to be the join keys.
540+ * ``left_on ``: Columns or index levels from the left DataFrame or Series to use as
541541 keys. Can either be column names, index level names, or arrays with length
542- equal to the length of the DataFrame.
543- * ``right_on ``: Columns or index levels from the right DataFrame to use as
542+ equal to the length of the DataFrame or Series .
543+ * ``right_on ``: Columns or index levels from the right DataFrame or Series to use as
544544 keys. Can either be column names, index level names, or arrays with length
545- equal to the length of the DataFrame.
545+ equal to the length of the DataFrame or Series .
546546* ``left_index ``: If ``True ``, use the index (row labels) from the left
547- DataFrame as its join key(s). In the case of a DataFrame with a MultiIndex
547+ DataFrame or Series as its join key(s). In the case of a DataFrame or Series with a MultiIndex
548548 (hierarchical), the number of levels must match the number of join keys
549- from the right DataFrame.
550- * ``right_index ``: Same usage as ``left_index `` for the right DataFrame
549+ from the right DataFrame or Series .
550+ * ``right_index ``: Same usage as ``left_index `` for the right DataFrame or Series
551551* ``how ``: One of ``'left' ``, ``'right' ``, ``'outer' ``, ``'inner' ``. Defaults
552552 to ``inner ``. See below for more detailed description of each method.
553553* ``sort ``: Sort the result DataFrame by the join keys in lexicographical
554554 order. Defaults to ``True ``, setting to ``False `` will improve performance
555555 substantially in many cases.
556556* ``suffixes ``: A tuple of string suffixes to apply to overlapping
557557 columns. Defaults to ``('_x', '_y') ``.
558- * ``copy ``: Always copy data (default ``True ``) from the passed DataFrame
558+ * ``copy ``: Always copy data (default ``True ``) from the passed DataFrame or named Series
559559 objects, even when reindexing is not necessary. Cannot be avoided in many
560560 cases but may improve performance / memory usage. The cases where copying
561561 can be avoided are somewhat pathological but this option is provided
562562 nonetheless.
563563* ``indicator ``: Add a column to the output DataFrame called ``_merge ``
564564 with information on the source of each row. ``_merge `` is Categorical-type
565565 and takes on a value of ``left_only `` for observations whose merge key
566- only appears in ``'left' `` DataFrame, ``right_only `` for observations whose
567- merge key only appears in ``'right' `` DataFrame, and ``both `` if the
566+ only appears in ``'left' `` DataFrame or Series , ``right_only `` for observations whose
567+ merge key only appears in ``'right' `` DataFrame or Series , and ``both `` if the
568568 observation's merge key is found in both.
569569
570570* ``validate `` : string, default None.
@@ -584,10 +584,10 @@ all standard database join operations between ``DataFrame`` objects:
584584
585585 Support for specifying index levels as the ``on ``, ``left_on ``, and
586586 ``right_on `` parameters was added in version 0.23.0.
587+ Support for merging named ``Series `` objects was added in version 0.24.0.
587588
588- The return type will be the same as ``left ``. If ``left `` is a ``DataFrame ``
589- and ``right `` is a subclass of DataFrame, the return type will still be
590- ``DataFrame ``.
589+ The return type will be the same as ``left ``. If ``left `` is a ``DataFrame `` or named ``Series ``
590+ and ``right `` is a subclass of ``DataFrame ``, the return type will still be ``DataFrame ``.
591591
592592``merge `` is a function in the pandas namespace, and it is also available as a
593593``DataFrame `` instance method :meth: `~DataFrame.merge `, with the calling
0 commit comments