-2

I want to enter my submission for the competition at https://www.kaggle.com/c/boston-dataset/data. But as it turns out there is sample Submission file.

Now I have tried removing column names, index but keep getting different errors.

Error snip

Any help is appreciated!

petezurich
  • 9,280
  • 9
  • 43
  • 57
Jay Nankani
  • 1
  • 1
  • 1

1 Answers1

0

Try this snippet:

submission = pd.DataFrame({ 'ID': test_data.ID.values, 'medv': predictions })
submission.to_csv("submission.csv", index=False)

where predictions is a list of your predictions for the test set.

petezurich
  • 9,280
  • 9
  • 43
  • 57