Skip to content

Commit 982a839

Browse files
anetakahlelofcz
andcommitted
DOC: Improve reshape\concat
Co-Authored-By: Matěj Štágl <[email protected]>
1 parent 7c01e13 commit 982a839

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/core/reshape/concat.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,20 @@ 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+
>>> df7 = pd.DataFrame({'a': 1, 'b': 2}, index=[0])
351+
>>> df7
352+
a b
353+
0 1 2
354+
>>> new_row = pd.Series([3])
355+
>>> new_row
356+
0 3
357+
>>> pd.concat([df7, new_row.to_frame().T], ignore_index=True)
358+
a b 0
359+
0 1.0 2.0 NaN
360+
1 NaN NaN 3.0
347361
"""
348362
op = _Concatenator(
349363
objs,

0 commit comments

Comments
 (0)