Skip to content

Commit 42da11a

Browse files
committed
DOC: added a reference to DataFrame assign in concatenate section of merging
Because of various stack overflow answers we are directed to the merging page where a link to DataFrame.assign would be better. Adding the reference here will make people's code better. At least it would have for me.
1 parent 2fdf1e2 commit 42da11a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/source/merging.rst

+7
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ the name of the ``Series``.
323323
labels=['df1', 's1'], vertical=False);
324324
plt.close('all');
325325
326+
.. note::
327+
328+
Since we're concatenating a ``Series`` to a ``DataFrame``, we could have
329+
achieved the same result with :meth:`DataFrame.assign`. To concatenate an
330+
arbitrary number of pandas objects (``DataFrame`` or ``Series``), use
331+
``concat``.
332+
326333
If unnamed ``Series`` are passed they will be numbered consecutively.
327334

328335
.. ipython:: python

doc/source/whatsnew/v0.23.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ Documentation Changes
658658
Rewrote some sentences for greater clarity, added more dynamic references
659659
to functions, methods and classes.
660660
(:issue:`18941`, :issue:`18948`, :issue:`18973`, :issue:`19017`)
661+
- Added a reference to :func:`DataFrame.assign` in the concatenate section of the merging documentation (:issue:`18665`)
661662
-
662663

663664
.. _whatsnew_0230.bug_fixes:

0 commit comments

Comments
 (0)