title: python- logistic regression, save predicted probabilities & predictions to csv
body: <p>I am new to data analysis and python. I have mostly been following the logistic regression demonstrated in this link on titanic survivors:</p>
  
  <p><a href="http://hamelg.blogspot.ca/2015/11/python-for-data-analysis-part-28.html" rel="nofollow noreferrer">http://hamelg.blogspot.ca/2015/11/python-for-data-analysis-part-28.html</a></p>
  
  <p>I am using my own non titanic dataset though. I am at the end of the example where I want to export the results to a csv file. I made a small modification though which is getting me stuck. In addition to the prediction, i also explicitly generated the predicted probabilities which I would also like to export to the csv file.</p>
  
  <pre><code>test_probs=log_model.predict_proba(X=test_features)
  print(test_probs)
  
  
  # Create a submission for Kaggle
  submission = pd.DataFrame({"AccountNumber":titanic_test["AccountNumber"],
  "PolarPredict":test_preds,**"probabilities":test_probs** })
  </code></pre>
  
  <p>This is the message i get: Exception: Data must be 1-dimensional</p>
  
  <p>here is the original code from the tutorial:
      # Make test set predictions
      test_preds = log_model.predict(X=test_features)</p>
  
  <pre><code># Create a submission for Kaggle
  submission = pd.DataFrame({"PassengerId":titanic_test["PassengerId"],
                         "Survived":test_preds})
  
  # Save submission to CSV
  submission.to_csv("tutorial_logreg_submission.csv", 
                index=False) 
  </code></pre>
  
  <p>How can I export the prediction, probabilities and the "ID" into a csv file?</p>