title: Adding statsmodels 'predict' results to a Pandas dataframe
body: <p>It is common to want to append the results of predictions to the dataset used to make the predictions, but the statsmodels <code>predict</code> function returns (non-indexed) results of a potentially different length than the dataset on which predictions are based.</p>
  
  <p>For example, if the test dataset, <code>test</code>, contains any null entries, then</p>
  
  <pre><code>mod_fit = sm.Logit.from_formula('Y ~ A B C', train).fit()
  press = mod_fit.predict(test)
  </code></pre>
  
  <p>will produce an array that is shorter than the length of <code>test</code>, and cannot be usefully appended with</p>
  
  <pre><code>test['preds'] = preds
  </code></pre>
  
  <p>And since the result of <code>predict</code> is not indexed, there is no way to recover the rows to which the results should be attached. </p>
  
  <p>What is the idiom for associating <code>predict</code> results to the rows from which they were generated? Is there, perhaps, a way to get <code>predict</code> to return a dataframe that preserves the indices of its argument?</p>