Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions lotto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@
"plt.rcParams['figure.figsize'] = (20.0, 10.0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"### Note on Data Source\n",
"\n",
"The original data source for this notebook is no longer available. To run the notebook, you need to manually download the data and place it in the correct directory.\n",
"\n",
"**Instructions:**\n",
"\n",
"1. **Download the data:**\n",
" * The data is available for download at [this link](https://github.com/dssg/hitchhikers-guide/blob/master/sources/ohio-lottery-data.zip).\n",
" * Click the \"Download\" button on that page to save the zip file to your computer.\n",
"\n",
"2. **Unzip the file:**\n",
" * Unzip the downloaded file. This will create a folder named `ohio-lottery-data`.\n",
"\n",
"3. **Place the data in the correct directory:**\n",
" * Move the `ohio-lottery-data` folder into the `data` subdirectory of this repository. The final path should be `data/ohio-lottery-data`.\n",
"\n",
"Once you have completed these steps, you can run the rest of the notebook.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -99,10 +123,14 @@
"file_name = \"649\"\n",
"\n",
"# download zip file and save\n",
"dl_file(url, data_path, file_name)\n",
"\n",
"# unzip to csv\n",
"unzip(data_path, file_name)\n"
"try:\n",
" dl_file(url, data_path, file_name)\n",
" # unzip to csv\n",
" unzip(data_path, file_name)\n",
"except Exception as e:\n",
" print(f'!!! An error occurred during download/unzip: {e}')\n",
" print('!!! Please check the URL and your internet connection.')\n",
" print('!!! You may need to manually download the data.')\n"
]
},
{
Expand Down