Skip to content

Commit 8ae610c

Browse files
committed
DOC: Improve reshape\concat
DOC: Improve reshape\concat
1 parent 7c01e13 commit 8ae610c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pandas/core/reshape/concat.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def concat(
173173
they are all None in which case a ValueError will be raised.
174174
axis : {0/'index', 1/'columns'}, default 0
175175
The axis to concatenate along.
176+
If 0, the outcome is identical to :meth:`DataFrame.append`.
176177
join : {'inner', 'outer'}, default 'outer'
177178
How to handle indexes on other axis (or axes).
178179
ignore_index : bool, default False
@@ -344,6 +345,22 @@ def concat(
344345
Traceback (most recent call last):
345346
...
346347
ValueError: Indexes have overlapping values: ['a']
348+
349+
Append a single row to the end of a ``DataFrame`` object.
350+
351+
>>> a = pd.DataFrame({"A": 1, "B": 2}, index=[0])
352+
>>> a
353+
A B
354+
0 1 2
355+
>>> b = pd.DataFrame({"A": 3}, index=[0])
356+
>>> b
357+
A
358+
0 3
359+
>>> for rowIndex, row in b.iterrows():
360+
>>> print(pd.concat([a, row.to_frame().T], ignore_index=True))
361+
A B
362+
0 1 2.0
363+
1 3 NaN
347364
"""
348365
op = _Concatenator(
349366
objs,

0 commit comments

Comments
 (0)