{
  "id": 66609,
  "title": "Save as CSV for submission",
  "url": "/competitions/airbus-ship-detection/discussion/66609",
  "author_name": "",
  "post_date": "2018-09-23T10:44:05.282570900Z",
  "votes": 1,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Hi</p>\n\n<p>I am new to Kaggle. May I know how to save the output as CSV? The input folder is read-only.</p>\n\n<p>Thank you.</p>",
  "messages": [
    {
      "id": "392246",
      "postDate": "09/23/2018 10:44:05",
      "content": "<p>Hi</p>\n\n<p>I am new to Kaggle. May I know how to save the output as CSV? The input folder is read-only.</p>\n\n<p>Thank you.</p>",
      "rawMarkdown": "Hi\n\nI am new to Kaggle. May I know how to save the output as CSV? The input folder is read-only.\n\nThank you.",
      "votes": null
    },
    {
      "id": "392259",
      "postDate": "09/23/2018 11:36:30",
      "content": "<p>Hi Kim,</p>\n\n<p>the convenient way is to create a pandas dataframe that includes the id for the test data and your predictions.\nThen you save the dataframe to csv. Put these lines at the end of your kernel:</p>\n\n<p>subm = pd.DataFrame() <br>\nsubm['Id'] = id_test <br>\nsubm['Predictions'] = predictions <br>\nsubm.to_csv('filename.csv', index=False)</p>\n\n<p>Or, for the Airbus competition, the dataframe needs to have these two columns: ImageId, EncodedPixels</p>\n\n<p>After running and committing your kernel you will find the tab \"Output\" in your kernel overview.\nAnd under Data Sources you find the csv file. From there you can also submit your results for the competition.\nHad the same question when starting, hope this helps!</p>",
      "rawMarkdown": "Hi Kim,\n\nthe convenient way is to create a pandas dataframe that includes the id for the test data and your predictions.\nThen you save the dataframe to csv. Put these lines at the end of your kernel:\n\nsubm = pd.DataFrame()  \nsubm['Id'] = id_test  \nsubm['Predictions'] = predictions  \nsubm.to_csv('filename.csv', index=False)\n\nOr, for the Airbus competition, the dataframe needs to have these two columns: ImageId, EncodedPixels\n\nAfter running and committing your kernel you will find the tab \"Output\" in your kernel overview.\nAnd under Data Sources you find the csv file. From there you can also submit your results for the competition.\nHad the same question when starting, hope this helps!",
      "votes": null
    },
    {
      "id": "393996",
      "postDate": "09/26/2018 07:16:49",
      "content": "<p>Thanks, this really helps! I have the DF, so just need to out put it to csv.</p>",
      "rawMarkdown": "Thanks, this really helps! I have the DF, so just need to out put it to csv.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 392259,
      "author_name": "dejavu23",
      "author_url": "",
      "post_date": "09/23/2018 11:36:30",
      "content": "<p>Hi Kim,</p>\n\n<p>the convenient way is to create a pandas dataframe that includes the id for the test data and your predictions.\nThen you save the dataframe to csv. Put these lines at the end of your kernel:</p>\n\n<p>subm = pd.DataFrame() <br>\nsubm['Id'] = id_test <br>\nsubm['Predictions'] = predictions <br>\nsubm.to_csv('filename.csv', index=False)</p>\n\n<p>Or, for the Airbus competition, the dataframe needs to have these two columns: ImageId, EncodedPixels</p>\n\n<p>After running and committing your kernel you will find the tab \"Output\" in your kernel overview.\nAnd under Data Sources you find the csv file. From there you can also submit your results for the competition.\nHad the same question when starting, hope this helps!</p>",
      "votes": null,
      "replies": [
        {
          "id": 393996,
          "author_name": "kimhoe",
          "author_url": "",
          "post_date": "09/26/2018 07:16:49",
          "content": "<p>Thanks, this really helps! I have the DF, so just need to out put it to csv.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "392246": "Hi\n\nI am new to Kaggle. May I know how to save the output as CSV? The input folder is read-only.\n\nThank you.",
    "392259": "Hi Kim,\n\nthe convenient way is to create a pandas dataframe that includes the id for the test data and your predictions.\nThen you save the dataframe to csv. Put these lines at the end of your kernel:\n\nsubm = pd.DataFrame()  \nsubm['Id'] = id_test  \nsubm['Predictions'] = predictions  \nsubm.to_csv('filename.csv', index=False)\n\nOr, for the Airbus competition, the dataframe needs to have these two columns: ImageId, EncodedPixels\n\nAfter running and committing your kernel you will find the tab \"Output\" in your kernel overview.\nAnd under Data Sources you find the csv file. From there you can also submit your results for the competition.\nHad the same question when starting, hope this helps!",
    "393996": "Thanks, this really helps! I have the DF, so just need to out put it to csv."
  },
  "source": "meta"
}