{
  "id": 57161,
  "title": "How to use the zip file easily?",
  "url": "/competitions/fgvc2018-flower/discussion/57161",
  "author_name": "VINCENT",
  "post_date": "2018-05-20T05:58:31.723000",
  "votes": 4,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Must I unzip the file \"train.zip\" before use it? Or there is a way that we can read the image from the zip file directly?</p>",
  "messages": [
    {
      "id": 836901,
      "postDate": "2020-05-07T10:54:27.453Z",
      "content": "<p><a href=\"/vincentbi\">@vincentbi</a> Yes you can directly use the zip file like this </p>\n\n<p><code>train = pd.read_csv('/kaggle/input/train.csv.zip')</code></p>\n\n<p>And us 'train' as yuo usaully do it. Kaggle automatically \nunzips them for you.</p>",
      "rawMarkdown": "@vincentbi Yes you can directly use the zip file like this \n\n`train = pd.read_csv('/kaggle/input/train.csv.zip')`\n\nAnd us 'train' as yuo usaully do it. Kaggle automatically \nunzips them for you.",
      "votes": 1,
      "replies": [
        {
          "id": 890054,
          "postDate": "2020-06-17T09:27:01.310Z",
          "content": "<p>it doesn't work for me, always file not found error</p>",
          "rawMarkdown": "it doesn't work for me, always file not found error",
          "votes": 1
        },
        {
          "id": 891315,
          "postDate": "2020-06-18T05:09:43.100Z",
          "content": "<p>It worked for me. You are trying it our with this Flower Classification dataset right? </p>",
          "rawMarkdown": "It worked for me. You are trying it our with this Flower Classification dataset right? "
        }
      ]
    },
    {
      "id": 330992,
      "postDate": "2018-05-20T05:58:31.723Z",
      "content": "<p>Must I unzip the file \"train.zip\" before use it? Or there is a way that we can read the image from the zip file directly?</p>",
      "rawMarkdown": "Must I unzip the file \"train.zip\" before use it? Or there is a way that we can read the image from the zip file directly?",
      "votes": 4
    },
    {
      "id": 331007,
      "postDate": "2018-05-20T06:58:35.923Z",
      "content": "<p>Use zipfile.. </p>\n\n<p><code>import zipfile</code>\nWill unzip the files so that you can see them..</p>\n\n<pre><code>with zipfile.ZipFile(\"../input/\"+Dataset+\".zip\",\"r\") as z:\nz.extractall(\".\")\n</code></pre>\n\n<p>After extracting it will get saved in <code>../input</code>,\nit can be easily read from there.  </p>\n\n<p>Hope it helps..! </p>",
      "rawMarkdown": "Use zipfile.. \n\n`import zipfile`\nWill unzip the files so that you can see them..\n\n    with zipfile.ZipFile(\"../input/\"+Dataset+\".zip\",\"r\") as z:\n    z.extractall(\".\")\nAfter extracting it will get saved in `../input`,\nit can be easily read from there.  \n\nHope it helps..! ",
      "votes": 1,
      "replies": [
        {
          "id": 331023,
          "postDate": "2018-05-20T07:31:42.510Z",
          "content": "<p>Thanks,it works.  I still want to know, is it possible to use the zipfile directly if we do not  extract it?</p>",
          "rawMarkdown": "Thanks,it works.  I still want to know, is it possible to use the zipfile directly if we do not  extract it?",
          "votes": 2
        },
        {
          "id": 331027,
          "postDate": "2018-05-20T07:36:45.083Z",
          "content": "<p><a href=\"https://stackoverflow.com/questions/19371860/python-open-file-from-zip-without-temporary-extracting-it\">Have a look here, though i never tried myself</a></p>",
          "rawMarkdown": "[Have a look here, though i never tried myself][1]\n\n\n  [1]: https://stackoverflow.com/questions/19371860/python-open-file-from-zip-without-temporary-extracting-it"
        },
        {
          "id": 331034,
          "postDate": "2018-05-20T08:11:32.677Z",
          "content": "<p>The link failed, I will try later. Thank u very much!</p>",
          "rawMarkdown": "The link failed, I will try later. Thank u very much!"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 836901,
      "author_name": "Bhanu Prakash",
      "author_url": "",
      "post_date": "2020-05-07T10:54:27.453000",
      "content": "<p><a href=\"/vincentbi\">@vincentbi</a> Yes you can directly use the zip file like this </p>\n\n<p><code>train = pd.read_csv('/kaggle/input/train.csv.zip')</code></p>\n\n<p>And us 'train' as yuo usaully do it. Kaggle automatically \nunzips them for you.</p>",
      "votes": 1,
      "replies": [
        {
          "id": 890054,
          "author_name": "cloudscomputes",
          "author_url": "",
          "post_date": "2020-06-17T09:27:01.310000",
          "content": "<p>it doesn't work for me, always file not found error</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 891315,
          "author_name": "Bhanu Prakash",
          "author_url": "",
          "post_date": "2020-06-18T05:09:43.100000",
          "content": "<p>It worked for me. You are trying it our with this Flower Classification dataset right? </p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 331007,
      "author_name": "dust",
      "author_url": "",
      "post_date": "2018-05-20T06:58:35.923000",
      "content": "<p>Use zipfile.. </p>\n\n<p><code>import zipfile</code>\nWill unzip the files so that you can see them..</p>\n\n<pre><code>with zipfile.ZipFile(\"../input/\"+Dataset+\".zip\",\"r\") as z:\nz.extractall(\".\")\n</code></pre>\n\n<p>After extracting it will get saved in <code>../input</code>,\nit can be easily read from there.  </p>\n\n<p>Hope it helps..! </p>",
      "votes": 1,
      "replies": [
        {
          "id": 331023,
          "author_name": "VINCENT",
          "author_url": "",
          "post_date": "2018-05-20T07:31:42.510000",
          "content": "<p>Thanks,it works.  I still want to know, is it possible to use the zipfile directly if we do not  extract it?</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 331027,
          "author_name": "dust",
          "author_url": "",
          "post_date": "2018-05-20T07:36:45.083000",
          "content": "<p><a href=\"https://stackoverflow.com/questions/19371860/python-open-file-from-zip-without-temporary-extracting-it\">Have a look here, though i never tried myself</a></p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 331034,
          "author_name": "VINCENT",
          "author_url": "",
          "post_date": "2018-05-20T08:11:32.677000",
          "content": "<p>The link failed, I will try later. Thank u very much!</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "836901": "@vincentbi Yes you can directly use the zip file like this \n\n`train = pd.read_csv('/kaggle/input/train.csv.zip')`\n\nAnd us 'train' as yuo usaully do it. Kaggle automatically \nunzips them for you.",
    "330992": "Must I unzip the file \"train.zip\" before use it? Or there is a way that we can read the image from the zip file directly?",
    "331007": "Use zipfile.. \n\n`import zipfile`\nWill unzip the files so that you can see them..\n\n    with zipfile.ZipFile(\"../input/\"+Dataset+\".zip\",\"r\") as z:\n    z.extractall(\".\")\nAfter extracting it will get saved in `../input`,\nit can be easily read from there.  \n\nHope it helps..! "
  }
}