{
  "id": 69638,
  "title": "File writing: please help",
  "url": "/competitions/airbus-ship-detection/discussion/69638",
  "author_name": "",
  "post_date": "2018-10-25T15:05:13.030999500Z",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I am creating a file like this:</p>\n\n<pre><code>arr_train_names_pd = pd.DataFrame(arr_train_names)\narr_train_names_pd.to_csv('arr_train_names.csv', index = False)\n</code></pre>\n\n<p>Then I load it back:</p>\n\n<pre><code>arr_train_names = pd.read_csv('arr_train_names.csv', index_col = False)\narr_train_names = np.asarray(arr_train_names).flatten()\n</code></pre>\n\n<p>File is present:</p>\n\n<pre><code>&amp;gt; ls ../working\n__notebook_source__.ipynb  arr_train_names.csv\n</code></pre>\n\n<p>Then i reload the notebook, and file is gone. Why? The idea is to not recalculate data every time, but to store in file...</p>",
  "messages": [
    {
      "id": "410176",
      "postDate": "10/25/2018 15:05:13",
      "content": "<p>I am creating a file like this:</p>\n\n<pre><code>arr_train_names_pd = pd.DataFrame(arr_train_names)\narr_train_names_pd.to_csv('arr_train_names.csv', index = False)\n</code></pre>\n\n<p>Then I load it back:</p>\n\n<pre><code>arr_train_names = pd.read_csv('arr_train_names.csv', index_col = False)\narr_train_names = np.asarray(arr_train_names).flatten()\n</code></pre>\n\n<p>File is present:</p>\n\n<pre><code>&amp;gt; ls ../working\n__notebook_source__.ipynb  arr_train_names.csv\n</code></pre>\n\n<p>Then i reload the notebook, and file is gone. Why? The idea is to not recalculate data every time, but to store in file...</p>",
      "rawMarkdown": "I am creating a file like this:\n\n    arr_train_names_pd = pd.DataFrame(arr_train_names)\n    arr_train_names_pd.to_csv('arr_train_names.csv', index = False)\n\nThen I load it back:\n\n    arr_train_names = pd.read_csv('arr_train_names.csv', index_col = False)\n    arr_train_names = np.asarray(arr_train_names).flatten()\n\nFile is present:\n\n    &gt; ls ../working\n    __notebook_source__.ipynb  arr_train_names.csv\n\nThen i reload the notebook, and file is gone. Why? The idea is to not recalculate data every time, but to store in file...",
      "votes": null
    },
    {
      "id": "410608",
      "postDate": "10/26/2018 10:43:06",
      "content": "<p>Hi Fizpok,</p>\n\n<p>Is this in a Kaggle Kernel? If it is, maybe Kaggle doesn't allow you to save files in any other folder than ../input/. Have you tried storing your files in the ../input/ folder? </p>\n\n<p>Hope this helps!</p>",
      "rawMarkdown": "Hi Fizpok,\n\nIs this in a Kaggle Kernel? If it is, maybe Kaggle doesn't allow you to save files in any other folder than ../input/. Have you tried storing your files in the ../input/ folder? \n\nHope this helps!",
      "votes": null
    },
    {
      "id": "410675",
      "postDate": "10/26/2018 12:36:31",
      "content": "<p>Thanks, I'll check. But the file does appear (I see it using \"ls\" command). It disappears after restart.</p>",
      "rawMarkdown": "Thanks, I'll check. But the file does appear (I see it using \"ls\" command). It disappears after restart.",
      "votes": null
    },
    {
      "id": "411043",
      "postDate": "10/27/2018 09:13:12",
      "content": "<p>Does not work:\nOSError: [Errno 30] Read-only file system: '../input/arr_train_names.csv'</p>",
      "rawMarkdown": "Does not work:\nOSError: [Errno 30] Read-only file system: '../input/arr_train_names.csv'",
      "votes": null
    },
    {
      "id": "411099",
      "postDate": "10/27/2018 12:16:54",
      "content": "<p>Hmm, then I guess the only option is to store the file locally and reupload it to the Kernel when you reload it. </p>",
      "rawMarkdown": "Hmm, then I guess the only option is to store the file locally and reupload it to the Kernel when you reload it.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 410608,
      "author_name": "carlolepelaars",
      "author_url": "",
      "post_date": "10/26/2018 10:43:06",
      "content": "<p>Hi Fizpok,</p>\n\n<p>Is this in a Kaggle Kernel? If it is, maybe Kaggle doesn't allow you to save files in any other folder than ../input/. Have you tried storing your files in the ../input/ folder? </p>\n\n<p>Hope this helps!</p>",
      "votes": null,
      "replies": [
        {
          "id": 410675,
          "author_name": "fizpok",
          "author_url": "",
          "post_date": "10/26/2018 12:36:31",
          "content": "<p>Thanks, I'll check. But the file does appear (I see it using \"ls\" command). It disappears after restart.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 411043,
          "author_name": "fizpok",
          "author_url": "",
          "post_date": "10/27/2018 09:13:12",
          "content": "<p>Does not work:\nOSError: [Errno 30] Read-only file system: '../input/arr_train_names.csv'</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 411099,
          "author_name": "carlolepelaars",
          "author_url": "",
          "post_date": "10/27/2018 12:16:54",
          "content": "<p>Hmm, then I guess the only option is to store the file locally and reupload it to the Kernel when you reload it. </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "410176": "I am creating a file like this:\n\n    arr_train_names_pd = pd.DataFrame(arr_train_names)\n    arr_train_names_pd.to_csv('arr_train_names.csv', index = False)\n\nThen I load it back:\n\n    arr_train_names = pd.read_csv('arr_train_names.csv', index_col = False)\n    arr_train_names = np.asarray(arr_train_names).flatten()\n\nFile is present:\n\n    &gt; ls ../working\n    __notebook_source__.ipynb  arr_train_names.csv\n\nThen i reload the notebook, and file is gone. Why? The idea is to not recalculate data every time, but to store in file...",
    "410608": "Hi Fizpok,\n\nIs this in a Kaggle Kernel? If it is, maybe Kaggle doesn't allow you to save files in any other folder than ../input/. Have you tried storing your files in the ../input/ folder? \n\nHope this helps!",
    "410675": "Thanks, I'll check. But the file does appear (I see it using \"ls\" command). It disappears after restart.",
    "411043": "Does not work:\nOSError: [Errno 30] Read-only file system: '../input/arr_train_names.csv'",
    "411099": "Hmm, then I guess the only option is to store the file locally and reupload it to the Kernel when you reload it."
  },
  "source": "meta"
}