Python 3.10 requires some operation when downloading, which is a bit different from the description in the book
- Dominant language
- Jupyter Notebook
- Stars
- 30k
- Forks
- 13.1k
- PR merge metrics
- No merged PRs in 30d
Description
```python
import os
import tarfile
import urllib
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
DOWNLOAD_ROOT ="https://raw.githubusercontent.com/ageron/handson-ml2/master/"
HOUSING_PATH = os.path.join("datasets","housing")
HOUSING_URL= DOWNLOAD_ROOT+"datasets/housing/housing.tgz"
def fetch_housing_data(housing_url=HOUSING_URL,housing_path=HOUSING_PATH):
os.makedirs(housing_path,exist_ok=True)
tgz_path=os.path.join(housing_path,"housing.tgz")
urllib.request.urlretrieve(housing_url,tgz_path)
housing_tgz=tarfile.open(tgz_path)
housing_tgz.extractall(path=housing_path)
housing_tgz.close()
fetch_housing_data()
```
The following is required to Cancel certificate validation globally
```
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.