1

I have a timeout error in reading my data.

I'm in my company, so I have to write pip install --proxy=http://ep.threatpulse.net:80 pandas in order to install pandas. Is it a prozy problem?

import pandas as pd
url = "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
df = pd.read_csv(url, names=['sepal length','sepal width','petal length','petal width','target'])

and the result comes like this:

urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

김혜연
  • 23
  • 1
  • 3
  • Possible duplicate of [Why can't I get Python's urlopen() method to work on Windows?](https://stackoverflow.com/questions/2923703/why-cant-i-get-pythons-urlopen-method-to-work-on-windows) – Chris Jan 25 '19 at 05:12

2 Answers2

0

Yes this error comes because its not able to establish a connection to the internet- network error or proxy setting issue. You can check the proxy setting on you IE, if its taking by default or try on another PC in the same network or ask system admin in your company to allow the access.

Jaba
  • 25
  • 7
0

You can try set the proxy something like this!

import io
import requests
proxy_dict = {"https":"https://xx.xx.x.xx:80"} #replace proxy setting here

response = requests.get(url, proxies=proxy_dict).text

df = pd.read_csv(io.StringIO(response),header=None)
df.columns = ['sepal length in cm','sepal width in cm',
               'petal length in cm','petal width in cm','class']
Venkatachalam
  • 16,288
  • 9
  • 49
  • 77