spacepaste

  1.  
  2. >>> import pandas as pd
  3. >>> from datetime import date
  4. >>> from mpl_finance import quotes_historical_yahoo_ochl
  5. >>> today = date.today()
  6. >>> start = (today.year-1,today.month,today.day)
  7. >>> quotes = quotes_historical_yahoo_ochl('AXP',start,today)
  8. Traceback (most recent call last):
  9. File "/usr/lib/python3.4/urllib/request.py", line 1183, in do_open
  10. h.request(req.get_method(), req.selector, req.data, headers)
  11. File "/usr/lib/python3.4/http/client.py", line 1137, in request
  12. self._send_request(method, url, body, headers)
  13. File "/usr/lib/python3.4/http/client.py", line 1182, in _send_request
  14. self.endheaders(body)
  15. File "/usr/lib/python3.4/http/client.py", line 1133, in endheaders
  16. self._send_output(message_body)
  17. File "/usr/lib/python3.4/http/client.py", line 963, in _send_output
  18. self.send(msg)
  19. File "/usr/lib/python3.4/http/client.py", line 898, in send
  20. self.connect()
  21. File "/usr/lib/python3.4/http/client.py", line 871, in connect
  22. self.timeout, self.source_address)
  23. File "/usr/lib/python3.4/socket.py", line 494, in create_connection
  24. for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  25. File "/usr/lib/python3.4/socket.py", line 533, in getaddrinfo
  26. for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  27. socket.gaierror: [Errno -2] Name or service not known
  28. During handling of the above exception, another exception occurred:
  29. Traceback (most recent call last):
  30. File "<stdin>", line 1, in <module>
  31. File "/usr/local/lib/python3.4/dist-packages/mpl_finance-0.10.0-py3.4.egg/mpl_finance.py", line 405, in quotes_historical_yahoo_ochl
  32. File "/usr/local/lib/python3.4/dist-packages/mpl_finance-0.10.0-py3.4.egg/mpl_finance.py", line 495, in _quotes_historical_yahoo
  33. File "/usr/local/lib/python3.4/dist-packages/mpl_finance-0.10.0-py3.4.egg/mpl_finance.py", line 354, in fetch_historical_yahoo
  34. File "/usr/lib/python3.4/urllib/request.py", line 161, in urlopen
  35. return opener.open(url, data, timeout)
  36. File "/usr/lib/python3.4/urllib/request.py", line 464, in open
  37. response = self._open(req, data)
  38. File "/usr/lib/python3.4/urllib/request.py", line 482, in _open
  39. '_open', req)
  40. File "/usr/lib/python3.4/urllib/request.py", line 442, in _call_chain
  41. result = func(*args)
  42. File "/usr/lib/python3.4/urllib/request.py", line 1211, in http_open
  43. return self.do_open(http.client.HTTPConnection, req)
  44. File "/usr/lib/python3.4/urllib/request.py", line 1185, in do_open
  45. raise URLError(err)
  46. urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
  47. >>>
  48.