Skip to content

Commit 9dfef3a

Browse files
committed
DOC: Improve reshape\concat
1 parent 7c01e13 commit 9dfef3a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/core/reshape/concat.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,22 @@ def concat(
344344
Traceback (most recent call last):
345345
...
346346
ValueError: Indexes have overlapping values: ['a']
347+
348+
Append a single row to the end of a ``DataFrame`` object.
349+
350+
>>> a = pd.DataFrame({"A": 1, "B": 2}, index=[0])
351+
>>> a
352+
A B
353+
0 1 2
354+
>>> b = pd.DataFrame({"A": 3}, index=[0])
355+
>>> b
356+
A
357+
0 3
358+
>>> for rowIndex, row in b.iterrows():
359+
>>> print(pd.concat([a, row.to_frame().T], ignore_index=True))
360+
A B
361+
0 1 2.0
362+
1 3 NaN
347363
"""
348364
op = _Concatenator(
349365
objs,

0 commit comments

Comments
 (0)