Answers for "append a row to a pandas dataframe"

25

add rows to dataframe pandas

df = df.append({'a':1, 'b':2}, ignore_index=True)
Posted by: Guest on September-21-2020
1

pandas insert row

df.loc[-1] = [2, 3, 4]  # adding a row
 df.index = df.index + 1  # shifting index
 df = df.sort_index()  # sorting by index
Posted by: Guest on June-26-2020

Code answers related to "append a row to a pandas dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language