File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,9 @@ def concat(
226
226
pandas objects can be found `here
227
227
<https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.html>`__.
228
228
229
+ It is not recommended to build DataFrames by adding single rows in a
230
+ for loop. Build a list of rows and make a DataFrame in a single concat.
231
+
229
232
Examples
230
233
--------
231
234
Combine two ``Series``.
@@ -344,6 +347,22 @@ def concat(
344
347
Traceback (most recent call last):
345
348
...
346
349
ValueError: Indexes have overlapping values: ['a']
350
+
351
+ Append a single row to the end of a ``DataFrame`` object.
352
+
353
+ >>> df7 = pd.DataFrame({'a': 1, 'b': 2}, index=[0])
354
+ >>> df7
355
+ a b
356
+ 0 1 2
357
+ >>> new_row = pd.Series({'a': 3, 'b': 4})
358
+ >>> new_row
359
+ a 3
360
+ b 4
361
+ dtype: int64
362
+ >>> pd.concat([df7, new_row.to_frame().T], ignore_index=True)
363
+ a b
364
+ 0 1 2
365
+ 1 3 4
347
366
"""
348
367
op = _Concatenator (
349
368
objs ,
You can’t perform that action at this time.
0 commit comments