Pandas Error reading_csv for url even though url is valid

I have a read_csv problem with url, the code below is running into errors even though the url is valid.

>>> import pandas as pd
>>> df = pd.read_csv("http://www.ats.ucla.edu/stat/data/binary.csv")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/pandas/io/parsers.py", line 102, in read_csv
    f = com._get_handle(filepath_or_buffer, 'r', encoding=encoding)
  File "/usr/lib/pymodules/python2.7/pandas/core/common.py", line 633, in _get_handle
    f = open(path, mode)
IOError: [Errno 2] No such file or directory: 'http://www.ats.ucla.edu/stat/data/binary.csv'
>>> 

      

read_csv only works if the file exists in my directory

df = pd.read_csv("./none_list.csv")

      

This is quite confusing, as the documentation says that the string can be a URL.

Can anyone help me?

thank

+3


source to share





All Articles