title: Pandas - How to control column order when appending to a DataFrame
body: <p>I am having a devilishly difficult time figuring out how to take a DataFrame with N rows, and a Series with N rows, and another Series with N rows, and joining it all together. Here's what I'm doing (wrong):</p>
  
  <pre><code>print df['Survived'].shape               # Series should be 1st column
  print pd.Series(kmeans.labels_).shape    # Series should be 2nd column
  print pd.DataFrame(X_pca).shape          # DataFrame should be remaining columns
  new_df = pd.DataFrame()
  new_df['Survived'] = df['Survived']
  new_df['ClusterId'] = pd.Series(kmeans.labels_)
  new_df = new_df.append(pd.DataFrame(X_pca))
  print new_df.shape
  print new_df.columns.values
  </code></pre>
  
  <p>and the output is:</p>
  
  <pre><code>(1309,)
  (1309,)
  (1309, 9)
  (2618, 11)
  [0L 1L 2L 3L 4L 5L 6L 7L 8L 'ClusterId' 'Survived']
  </code></pre>
  
  <p>Two things I don't understand:</p>
  
  <ol>
  <li>The sequence of the columns is all wrong. I've tried starting with the DataFrame, then appending the 'ClusterId' Series, then finally the 'Survived' Series, but the column order of the resulting DataFrame is exactly the same.</li>
  <li>After appending the dataframe with DataFrame.append, the number of rows of the resulting dataframe has doubled</li>
  </ol>
  
  <p>I've tried reading the documentation but I'm having a really tough time finding anything covering exactly what I'm trying to do (which oddly doesn't seem like an unusual thing to do). I've also attempted <code>pd.concat([Series, Series, DataFrame], axis=1)</code> but that throws an error: <code>pandas.core.index.InvalidIndexError: Reindexing only valid with uniquely valued Index objects</code></p>