---------------------------------------------------------------------------
ConnectionRefusedError Traceback (most recent call last)
/usr/lib/python3.4/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1181 try:
-> 1182 h.request(req.get_method(), req.selector, req.data, headers)
1183 except OSError as err: # timeout error
/usr/lib/python3.4/http/client.py in request(self, method, url, body, headers)
1087 """Send a complete request to the server."""
-> 1088 self._send_request(method, url, body, headers)
1089
/usr/lib/python3.4/http/client.py in _send_request(self, method, url, body, headers)
1125 body = body.encode('iso-8859-1')
-> 1126 self.endheaders(body)
1127
/usr/lib/python3.4/http/client.py in endheaders(self, message_body)
1083 raise CannotSendHeader()
-> 1084 self._send_output(message_body)
1085
/usr/lib/python3.4/http/client.py in _send_output(self, message_body)
921 message_body = None
--> 922 self.send(msg)
923 if message_body is not None:
/usr/lib/python3.4/http/client.py in send(self, data)
856 if self.auto_open:
--> 857 self.connect()
858 else:
/usr/lib/python3.4/http/client.py in connect(self)
833 self.sock = self._create_connection((self.host,self.port),
--> 834 self.timeout, self.source_address)
835
/usr/lib/python3.4/socket.py in create_connection(address, timeout, source_address)
511 if err is not None:
--> 512 raise err
513 else:
/usr/lib/python3.4/socket.py in create_connection(address, timeout, source_address)
502 sock.bind(source_address)
--> 503 sock.connect(sa)
504 return sock
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
URLError Traceback (most recent call last)
<ipython-input-17-519adf3a77a8> in <module>()
1 from sklearn.datasets import fetch_mldata
2 import pandas as pd
----> 3 earthquakes = fetch_mldata('global-earthquakes')
4 print (earthquakes.data)
5 print (earthquakes.data.shape)
/usr/local/lib/python3.4/dist-packages/sklearn/datasets/mldata.py in fetch_mldata(dataname, target_name, data_name, transpose_data, data_home)
140 urlname = MLDATA_BASE_URL % quote(dataname)
141 try:
--> 142 mldata_url = urlopen(urlname)
143 except HTTPError as e:
144 if e.code == 404:
/usr/lib/python3.4/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
159 else:
160 opener = _opener
--> 161 return opener.open(url, data, timeout)
162
163 def install_opener(opener):
/usr/lib/python3.4/urllib/request.py in open(self, fullurl, data, timeout)
461 req = meth(req)
462
--> 463 response = self._open(req, data)
464
465 # post-process response
/usr/lib/python3.4/urllib/request.py in _open(self, req, data)
479 protocol = req.type
480 result = self._call_chain(self.handle_open, protocol, protocol +
--> 481 '_open', req)
482 if result:
483 return result
/usr/lib/python3.4/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
439 for handler in handlers:
440 func = getattr(handler, meth_name)
--> 441 result = func(*args)
442 if result is not None:
443 return result
/usr/lib/python3.4/urllib/request.py in http_open(self, req)
1208
1209 def http_open(self, req):
-> 1210 return self.do_open(http.client.HTTPConnection, req)
1211
1212 http_request = AbstractHTTPHandler.do_request_
/usr/lib/python3.4/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1182 h.request(req.get_method(), req.selector, req.data, headers)
1183 except OSError as err: # timeout error
-> 1184 raise URLError(err)
1185 r = h.getresponse()
1186 except:
URLError: <urlopen error [Errno 111] Connection refused>