urllib.error.URLError when using pandas read_csv

Question:

I’m new to Python and trying to download a csv file from the URL below but get an error as below
https://mldata.org/repository/data/download/csv/stockvalues/

script to download csv which is not working

import pandas as pd

import numpy as np

url = 'https://mldata.org/repository/data/download/csv/stockvalues.csv'

url_data = pd.read_table(url,sep='t')

url_data.head(3)

Receive the error below

urllib.error.URLError occurred Message=<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>
  StackTrace:

C:Program FilesAnaconda3liburllibrequest.py:1320 in AbstractHTTPHandler.do_open

C:Program FilesAnaconda3liburllibrequest.py:1361 in HTTPSHandler.https_open

C:Program FilesAnaconda3liburllibrequest.py:504 in OpenerDirector._call_chain

C:Program FilesAnaconda3liburllibrequest.py:544 in OpenerDirector._open

C:Program FilesAnaconda3liburllibrequest.py:526 in OpenerDirector.open

C:Program FilesAnaconda3liburllibrequest.py:223 in urlopen

C:Program FilesAnaconda3libsite-packagespandasiocommon.py:186 in get_filepath_or_buffer

C:Program FilesAnaconda3libsite-packagespandasioparsers.py:392 in _read

C:Program FilesAnaconda3libsite-packagespandasioparsers.py:655 in parser_f in _make_parser_function
Asked By: Jag99

||

Answers:

Your url has issues. That error occurs when the url’s certificate isn’t trusted by your browser. This definitely means there’s either something wrong with the site, or something wrong with the link.

Answered By: cs95
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.