(I´m new to python, sorry for any mistakes I make, I hope you can understand me)
I have searched for a method to insert a Row into a Pandas DataFrame in Python, and
With a small DataFrame, if you want to insert a line, at position 1:
DataFrame
1
df = pd.DataFrame({'a':[0,1],'b':[2,3]}) df1 = pd.DataFrame([4,5]).T pd.concat([df[:1], df1.rename(columns=dict(zip(df1.columns,df.columns))), df[1:]]) #Out[46]: # a b #0 0 2 #0 4 5 #1 1 3