title: Adding row in Pandas DataFrame keeping index order
body: <p>I have a <code>DataFrame</code> and I would like to add some inexisting rows to it. I have found the <code>.loc</code> method, but this adds the values at the end, and not in a sorted way. For example</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  dfi = pd.DataFrame(np.arange(6).reshape(3,2),columns=['A','B'])
  
  &gt;&gt;&gt; dfi
      A B
  0   0 1
  1   2 3
  2   4 5
  [3 rows x 2 columns]
  </code></pre>
  
  <p>Adding a inexisting row through <code>.loc</code>:</p>
  
  <pre><code>dfi.loc[5,:] = 0
  &gt;&gt;&gt; dfi
      A B
  0   0 1
  1   2 3
  2   4 5
  5   0 0
  [3 rows x 2 columns]
  </code></pre>
  
  <p>So far everything ok. But this is what happens when trying to add another row, with index smaller than the last one:</p>
  
  <pre><code>dfi.loc[3,:] = 0
  &gt;&gt;&gt; dfi
      A B
  0   0 1
  1   2 3
  2   4 5
  5   0 0
  3   0 0
  [3 rows x 2 columns]
  </code></pre>
  
  <p>I would like it to put the row with index <code>3</code> between the row <code>2</code> and the <code>5</code>. I could sort the <code>DataFrame</code> by index everytime, but that would take too long. Is there another way?</p>
  
  <p>My actual problem is considering a <code>DataFrame</code> where the indexes are <code>datetime</code> objects. I didn't put the whole detail of that implementation here because that would confuse what my real problem is: adding rows in <code>DataFrame</code> such that the result has an ordered index.</p>