rename download_and_unzip to make it more specific

This commit is contained in:
rasbt
2024-05-12 08:36:24 -05:00
parent 58c591c0e0
commit 55c3a91838
4 changed files with 9 additions and 9 deletions

View File

@@ -187,7 +187,7 @@
"extracted_path = \"sms_spam_collection\"\n",
"data_file_path = Path(extracted_path) / \"SMSSpamCollection.tsv\"\n",
"\n",
"def download_and_unzip(url, zip_path, extracted_path, data_file_path):\n",
"def download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path):\n",
" if data_file_path.exists():\n",
" print(f\"{data_file_path} already exists. Skipping download and extraction.\")\n",
" return\n",
@@ -206,7 +206,7 @@
" os.rename(original_file_path, data_file_path)\n",
" print(f\"File downloaded and saved as {data_file_path}\")\n",
"\n",
"download_and_unzip(url, zip_path, extracted_path, data_file_path)"
"download_and_unzip_spam_data(url, zip_path, extracted_path, data_file_path)"
]
},
{
@@ -2347,7 +2347,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.10.6"
}
},
"nbformat": 4,