{
  "id": 386583,
  "title": "Submission error - Permission error when creating a file called submission.csv",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/386583",
  "author_name": "",
  "post_date": "2023-02-13T18:53:44.337338400Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>After producing my predictions in a <code>Pandas.DataFrame</code>, I can't seem to create the required <code>submission.csv</code> file by running this as usual:</p>\n<pre><code>df.to_csv(\"submission.csv\", index=False)\n</code></pre>\n<p>When I run the code above, I get this error:</p>\n<pre><code>PermissionError: [Errno 1] Operation not permitted: 'submission.csv'\n</code></pre>",
  "messages": [
    {
      "id": "2142757",
      "postDate": "02/13/2023 18:53:44",
      "content": "<p>After producing my predictions in a <code>Pandas.DataFrame</code>, I can't seem to create the required <code>submission.csv</code> file by running this as usual:</p>\n<pre><code>df.to_csv(\"submission.csv\", index=False)\n</code></pre>\n<p>When I run the code above, I get this error:</p>\n<pre><code>PermissionError: [Errno 1] Operation not permitted: 'submission.csv'\n</code></pre>",
      "rawMarkdown": "After producing my predictions in a `Pandas.DataFrame`, I can't seem to create the required `submission.csv` file by running this as usual:\n```\ndf.to_csv(\"submission.csv\", index=False)\n```\n\nWhen I run the code above, I get this error:\n```\nPermissionError: [Errno 1] Operation not permitted: 'submission.csv'\n```",
      "votes": null
    },
    {
      "id": "2142770",
      "postDate": "02/13/2023 19:01:27",
      "content": "<p>This was my mistake, I just needed to read the <code>Data</code> section carefully. </p>\n<p>After reading it again, it clearly states:</p>\n<pre><code>When you are ready to predict, use the sample notebook to iterate over the test data, which is split as described above and served up as Pandas dataframes. Make your predictions for each group of questions - at the end of this process a submission.csv file will have been created for you. Simply submit your notebook.\n</code></pre>\n<p>The correct way to submit can be found in <a href=\"https://www.kaggle.com/code/philculliton/basic-submission-demo\" target=\"_blank\">this notebook</a> from <a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> (thanks Phil 👍)<br>\nThe  important part is this:</p>\n<pre><code>import jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()\n\ncounter = 0\n# The API will deliver two dataframes in this specific order,\n# for every session+level grouping (one group per session for each checkpoint)\nfor (sample_submission, test) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n\n    ## users make predictions here using the test data\n    sample_submission['correct'] = 0\n\n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1\n</code></pre>",
      "rawMarkdown": "This was my mistake, I just needed to read the `Data` section carefully. \n\nAfter reading it again, it clearly states:\n```\nWhen you are ready to predict, use the sample notebook to iterate over the test data, which is split as described above and served up as Pandas dataframes. Make your predictions for each group of questions - at the end of this process a submission.csv file will have been created for you. Simply submit your notebook.\n```\n\nThe correct way to submit can be found in [this notebook](https://www.kaggle.com/code/philculliton/basic-submission-demo) from @philculliton (thanks Phil 👍)\nThe  important part is this:\n```\nimport jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()\n\ncounter = 0\n# The API will deliver two dataframes in this specific order,\n# for every session+level grouping (one group per session for each checkpoint)\nfor (sample_submission, test) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n        \n    ## users make predictions here using the test data\n    sample_submission['correct'] = 0\n    \n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1\n```",
      "votes": null
    },
    {
      "id": "2232207",
      "postDate": "04/24/2023 05:46:37",
      "content": "<p>hi there! I followed the code in the notebook exactly but when I submit it still pops up a submission score error:<br>\nYour notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected. See more debugging tips</p>",
      "rawMarkdown": "hi there! I followed the code in the notebook exactly but when I submit it still pops up a submission score error:\nYour notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected. See more debugging tips",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2142770,
      "author_name": "ruanpretorius",
      "author_url": "",
      "post_date": "02/13/2023 19:01:27",
      "content": "<p>This was my mistake, I just needed to read the <code>Data</code> section carefully. </p>\n<p>After reading it again, it clearly states:</p>\n<pre><code>When you are ready to predict, use the sample notebook to iterate over the test data, which is split as described above and served up as Pandas dataframes. Make your predictions for each group of questions - at the end of this process a submission.csv file will have been created for you. Simply submit your notebook.\n</code></pre>\n<p>The correct way to submit can be found in <a href=\"https://www.kaggle.com/code/philculliton/basic-submission-demo\" target=\"_blank\">this notebook</a> from <a href=\"https://www.kaggle.com/philculliton\" target=\"_blank\">@philculliton</a> (thanks Phil 👍)<br>\nThe  important part is this:</p>\n<pre><code>import jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()\n\ncounter = 0\n# The API will deliver two dataframes in this specific order,\n# for every session+level grouping (one group per session for each checkpoint)\nfor (sample_submission, test) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n\n    ## users make predictions here using the test data\n    sample_submission['correct'] = 0\n\n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2232207,
      "author_name": "nicholasleong92",
      "author_url": "",
      "post_date": "04/24/2023 05:46:37",
      "content": "<p>hi there! I followed the code in the notebook exactly but when I submit it still pops up a submission score error:<br>\nYour notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected. See more debugging tips</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2142757": "After producing my predictions in a `Pandas.DataFrame`, I can't seem to create the required `submission.csv` file by running this as usual:\n```\ndf.to_csv(\"submission.csv\", index=False)\n```\n\nWhen I run the code above, I get this error:\n```\nPermissionError: [Errno 1] Operation not permitted: 'submission.csv'\n```",
    "2142770": "This was my mistake, I just needed to read the `Data` section carefully. \n\nAfter reading it again, it clearly states:\n```\nWhen you are ready to predict, use the sample notebook to iterate over the test data, which is split as described above and served up as Pandas dataframes. Make your predictions for each group of questions - at the end of this process a submission.csv file will have been created for you. Simply submit your notebook.\n```\n\nThe correct way to submit can be found in [this notebook](https://www.kaggle.com/code/philculliton/basic-submission-demo) from @philculliton (thanks Phil 👍)\nThe  important part is this:\n```\nimport jo_wilder\nenv = jo_wilder.make_env()\niter_test = env.iter_test()\n\ncounter = 0\n# The API will deliver two dataframes in this specific order,\n# for every session+level grouping (one group per session for each checkpoint)\nfor (sample_submission, test) in iter_test:\n    if counter == 0:\n        print(sample_submission.head())\n        print(test.head())\n        print(test.shape)\n        \n    ## users make predictions here using the test data\n    sample_submission['correct'] = 0\n    \n    ## env.predict appends the session+level sample_submission to the overall\n    ## submission\n    env.predict(sample_submission)\n    counter += 1\n```",
    "2232207": "hi there! I followed the code in the notebook exactly but when I submit it still pops up a submission score error:\nYour notebook generated a submission file with incorrect format. Some examples causing this are: wrong number of rows or columns, empty values, an incorrect data type for a value, or invalid submission values from what is expected. See more debugging tips"
  },
  "source": "meta"
}