First I have the following empty DataFrame preallocated:
df=DataFrame(columns=range(10000),index=range(1000))
Then I want to update the d
df=DataFrame(columns=range(10),index=range(10))
a = np.array( [9,9,9,9,9,9,9,9,9,9] )
Update row:
df.loc[2] = a
Using Jeff's idea...
df2 = DataFrame(data=np.random.randn(10,10), index=arange(10))
df2.head().T
I have written up a notebook answering the question: https://www.wakari.io/sharing/bundle/hrojas/pandas%20efficient%20dataframe%20set%20row