{
  "id": 42478,
  "title": "How to view the data?",
  "url": "/competitions/favorita-grocery-sales-forecasting/discussion/42478",
  "author_name": "",
  "post_date": "2017-10-31T14:06:49.278320Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I tried to download the CSV files but they do not open in anything I can read - If I download onto a note-pad or other I just get an encrypted file. Do I need a specific platform/App to read the files? Can anyone give a short tutorial on how to download and load the data. </p>",
  "messages": [
    {
      "id": "238010",
      "postDate": "10/31/2017 14:06:49",
      "content": "<p>I tried to download the CSV files but they do not open in anything I can read - If I download onto a note-pad or other I just get an encrypted file. Do I need a specific platform/App to read the files? Can anyone give a short tutorial on how to download and load the data. </p>",
      "rawMarkdown": "I tried to download the CSV files but they do not open in anything I can read - If I download onto a note-pad or other I just get an encrypted file. Do I need a specific platform/App to read the files? Can anyone give a short tutorial on how to download and load the data.",
      "votes": null
    },
    {
      "id": "238011",
      "postDate": "10/31/2017 14:10:00",
      "content": "<p>All of the data files are in 7-Zip format. You need to download the 7-Zip program to extract the data to a regular .csv file.</p>",
      "rawMarkdown": "All of the data files are in 7-Zip format. You need to download the 7-Zip program to extract the data to a regular .csv file.",
      "votes": null
    },
    {
      "id": "238025",
      "postDate": "10/31/2017 14:21:51",
      "content": "<p>It really depends on what you want to do with it. If you would like to browse, microsoft excel would do it (or Google Sheets also display the data as an alternative). If you would like to manipulate or analyze the data, pandas library from Python would be the best way to do it. </p>\n\n<pre><code>import pandas as pd\nDataFromCSV = pd.DataFrame.from_csv(path_to_the_file)\n</code></pre>\n\n<p>Now, DataFromCSV's type would be DataFrame, which is a popular type for analyzing and accessing data from table-looking-organized data file. </p>",
      "rawMarkdown": "It really depends on what you want to do with it. If you would like to browse, microsoft excel would do it (or Google Sheets also display the data as an alternative). If you would like to manipulate or analyze the data, pandas library from Python would be the best way to do it. \n\n    import pandas as pd\n    DataFromCSV = pd.DataFrame.from_csv(path_to_the_file)\n\nNow, DataFromCSV's type would be DataFrame, which is a popular type for analyzing and accessing data from table-looking-organized data file.",
      "votes": null
    },
    {
      "id": "238235",
      "postDate": "10/31/2017 23:05:38",
      "content": "<p>The problem is that there isn't enough memory for the whole data.\nIf you want to read only some of the file in python:</p>\n\n<p>I don't know why the code doesn't work for me. Here is the code</p>\n\n<p>import pandas as pd</p>\n\n<p>import numpy as np</p>\n\n<p>import csv</p>\n\n<p>train_n_row = 10</p>\n\n<p>for file_name in file_paths:</p>\n\n<pre><code>if \"train\" not in file_name:\n\n    print(file_name)\n\n    print(pd.DataFrame.from_csv(file_name).head())\n</code></pre>\n\n<p>with open('inputs/train.csv', newline='') as csvfile:</p>\n\n<pre><code>csvreader = csv.reader(csvfile, delimiter=',')\n\ncolumn_names = csvfile.readline().replace(\"\\n\", \"\").split(\",\")\n\nsamples = []\n\nfor i, row in enumerate(csvreader):\n\n    if i &lt; train_n_row:\n\n        samples.append(row)\n\n    else:\n\n        break\n</code></pre>\n\n<p>train = pd.DataFrame(data=np.array(samples), columns=column_names)</p>\n\n<p>train.index = train[\"id\"]</p>\n\n<p>del train[\"id\"]</p>\n\n<p>print(train)</p>\n\n<p>print(train[\"onpromotion\"].value_counts())</p>",
      "rawMarkdown": "The problem is that there isn't enough memory for the whole data.\nIf you want to read only some of the file in python:\n\nI don't know why the code doesn't work for me. Here is the code\n\nimport pandas as pd\n\nimport numpy as np\n\nimport csv\n\ntrain_n_row = 10\n\nfor file_name in file_paths:\n\n    if \"train\" not in file_name:\n\n        print(file_name)\n\n        print(pd.DataFrame.from_csv(file_name).head())\n\n\nwith open('inputs/train.csv', newline='') as csvfile:\n\n    csvreader = csv.reader(csvfile, delimiter=',')\n\n    column_names = csvfile.readline().replace(\"\\n\", \"\").split(\",\")\n\n    samples = []\n\n    for i, row in enumerate(csvreader):\n\n        if i &lt; train_n_row:\n\n            samples.append(row)\n\n        else:\n\n            break\n\ntrain = pd.DataFrame(data=np.array(samples), columns=column_names)\n\ntrain.index = train[\"id\"]\n\ndel train[\"id\"]\n\nprint(train)\n\nprint(train[\"onpromotion\"].value_counts())",
      "votes": null
    },
    {
      "id": "316525",
      "postDate": "04/19/2018 09:27:34",
      "content": "<p>Do we download the 7-zip formatted file to our local - extract and upload back to the notebook ?</p>",
      "rawMarkdown": "Do we download the 7-zip formatted file to our local - extract and upload back to the notebook ?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 238011,
      "author_name": "gmurrayhays",
      "author_url": "",
      "post_date": "10/31/2017 14:10:00",
      "content": "<p>All of the data files are in 7-Zip format. You need to download the 7-Zip program to extract the data to a regular .csv file.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 238025,
      "author_name": "",
      "author_url": "",
      "post_date": "10/31/2017 14:21:51",
      "content": "<p>It really depends on what you want to do with it. If you would like to browse, microsoft excel would do it (or Google Sheets also display the data as an alternative). If you would like to manipulate or analyze the data, pandas library from Python would be the best way to do it. </p>\n\n<pre><code>import pandas as pd\nDataFromCSV = pd.DataFrame.from_csv(path_to_the_file)\n</code></pre>\n\n<p>Now, DataFromCSV's type would be DataFrame, which is a popular type for analyzing and accessing data from table-looking-organized data file. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 238235,
      "author_name": "mrbeer",
      "author_url": "",
      "post_date": "10/31/2017 23:05:38",
      "content": "<p>The problem is that there isn't enough memory for the whole data.\nIf you want to read only some of the file in python:</p>\n\n<p>I don't know why the code doesn't work for me. Here is the code</p>\n\n<p>import pandas as pd</p>\n\n<p>import numpy as np</p>\n\n<p>import csv</p>\n\n<p>train_n_row = 10</p>\n\n<p>for file_name in file_paths:</p>\n\n<pre><code>if \"train\" not in file_name:\n\n    print(file_name)\n\n    print(pd.DataFrame.from_csv(file_name).head())\n</code></pre>\n\n<p>with open('inputs/train.csv', newline='') as csvfile:</p>\n\n<pre><code>csvreader = csv.reader(csvfile, delimiter=',')\n\ncolumn_names = csvfile.readline().replace(\"\\n\", \"\").split(\",\")\n\nsamples = []\n\nfor i, row in enumerate(csvreader):\n\n    if i &lt; train_n_row:\n\n        samples.append(row)\n\n    else:\n\n        break\n</code></pre>\n\n<p>train = pd.DataFrame(data=np.array(samples), columns=column_names)</p>\n\n<p>train.index = train[\"id\"]</p>\n\n<p>del train[\"id\"]</p>\n\n<p>print(train)</p>\n\n<p>print(train[\"onpromotion\"].value_counts())</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 316525,
      "author_name": "fabulinus",
      "author_url": "",
      "post_date": "04/19/2018 09:27:34",
      "content": "<p>Do we download the 7-zip formatted file to our local - extract and upload back to the notebook ?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "238010": "I tried to download the CSV files but they do not open in anything I can read - If I download onto a note-pad or other I just get an encrypted file. Do I need a specific platform/App to read the files? Can anyone give a short tutorial on how to download and load the data.",
    "238011": "All of the data files are in 7-Zip format. You need to download the 7-Zip program to extract the data to a regular .csv file.",
    "238025": "It really depends on what you want to do with it. If you would like to browse, microsoft excel would do it (or Google Sheets also display the data as an alternative). If you would like to manipulate or analyze the data, pandas library from Python would be the best way to do it. \n\n    import pandas as pd\n    DataFromCSV = pd.DataFrame.from_csv(path_to_the_file)\n\nNow, DataFromCSV's type would be DataFrame, which is a popular type for analyzing and accessing data from table-looking-organized data file.",
    "238235": "The problem is that there isn't enough memory for the whole data.\nIf you want to read only some of the file in python:\n\nI don't know why the code doesn't work for me. Here is the code\n\nimport pandas as pd\n\nimport numpy as np\n\nimport csv\n\ntrain_n_row = 10\n\nfor file_name in file_paths:\n\n    if \"train\" not in file_name:\n\n        print(file_name)\n\n        print(pd.DataFrame.from_csv(file_name).head())\n\n\nwith open('inputs/train.csv', newline='') as csvfile:\n\n    csvreader = csv.reader(csvfile, delimiter=',')\n\n    column_names = csvfile.readline().replace(\"\\n\", \"\").split(\",\")\n\n    samples = []\n\n    for i, row in enumerate(csvreader):\n\n        if i &lt; train_n_row:\n\n            samples.append(row)\n\n        else:\n\n            break\n\ntrain = pd.DataFrame(data=np.array(samples), columns=column_names)\n\ntrain.index = train[\"id\"]\n\ndel train[\"id\"]\n\nprint(train)\n\nprint(train[\"onpromotion\"].value_counts())",
    "316525": "Do we download the 7-zip formatted file to our local - extract and upload back to the notebook ?"
  },
  "source": "meta"
}