Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1 download data code isn't working #57

Closed
HelloWorld183L opened this issue May 5, 2022 · 5 comments
Closed

Chapter 1 download data code isn't working #57

HelloWorld183L opened this issue May 5, 2022 · 5 comments

Comments

@HelloWorld183L
Copy link

HelloWorld183L commented May 5, 2022

I found that the original code seems to be outdated since it seems to use a different repository name (BiteSizeBayes) and it uses a csv file whereas the current data is in a gss_bayes folder which I don't know how to read/use (normally I use csv files). Can anyone give guidance on how to read in this data (e.g. docs) or a pointer on where to find the original GSS data? Thanks in advance.

Here's the original code for context:

`# Load the data file

from os.path import basename, exists

def download(url):
filename = basename(url)
if not exists(filename):
from urllib.request import urlretrieve
local, _ = urlretrieve(url, filename)
print('Downloaded ' + local)

download('https://github.com/AllenDowney/BiteSizeBayes/raw/master/gss_bayes.csv')`

@AllenDowney
Copy link
Owner

Which file is this in?

@HelloWorld183L
Copy link
Author

Which file is this in?

This is in chap01.ipynb (https://github.com/AllenDowney/ThinkBayes2/blob/master/notebooks/chap01.ipynb)

@AllenDowney
Copy link
Owner

This notebook runs on Colab without problems:

https://colab.research.google.com/github/AllenDowney/ThinkBayes2/blob/master/notebooks/chap01.ipynb

I recommend running the notebooks on Colab.

I think I don't understand what you are asking.

@HelloWorld183L
Copy link
Author

HelloWorld183L commented May 6, 2022

What I was trying to say was that the notebook I linked doesn't retrieve the gss_bayes.csv file properly (404) whereas the Collab notebook works fine. I don't see the gss_bayes.csv file in this GitHub repository and the Collab notebook ends up using the csv file from a different repository which I initially found confusing since there's a "gss_bayes" folder that I assumed would have the data I need. In other words, I assumed the original data was meant to be in this repository because of the different data folders and the "gss_bayes" folder. I'll stick to the Collab notebooks for now since they seem to work just fine.

For extra context, here is the error I was getting when running the non-Collab notebook:

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1125)>

@AllenDowney
Copy link
Owner

It's intentional that it's coming from a different repo. But maybe that's causing something in your development environment to object. Anyway, if Colab works, you are all set!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants