seaborn 모듈 설치 이후 (맥북 > jupyter notebook)
1106
작성한 질문수 3
seaborn 설치 이후,
df = sns.load_dataset("iris")
를 입력했는데 다음과 같은 에러 메시지가 뜹니다.
원인이 무얼까요?
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py in connect(self) 1423 -> 1424 self.sock = self._context.wrap_socket(self.sock, 1425 server_hostname=server_hostname) /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session) 499 # ctx._wrap_socket() --> 500 return self.sslsocket_class._create( 501 sock=sock, /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py in _create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session) 1039 raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") -> 1040 self.do_handshake() 1041 except (OSError, ValueError): /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py in do_handshake(self, block) 1308 self.settimeout(None) -> 1309 self._sslobj.do_handshake() 1310 finally: SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122) During handling of the above exception, another exception occurred: URLError Traceback (most recent call last) <ipython-input-6-87515bdb8e81> in <module> ----> 1 df = sns.load_dataset("iris") 2 df /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/seaborn/utils.py in load_dataset(name, cache, data_home, **kws) 483 os.path.basename(full_path)) 484 if not os.path.exists(cache_path): --> 485 if name not in get_dataset_names(): 486 raise ValueError(f"'{name}' is not one of the example datasets.") 487 urlretrieve(full_path, cache_path) /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/seaborn/utils.py in get_dataset_names() 417 """ 418 url = "https://github.com/mwaskom/seaborn-data" --> 419 with urlopen(url) as resp: 420 html = resp.read() 421 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 212 else: 213 opener = _opener --> 214 return opener.open(url, data, timeout) 215 216 def install_opener(opener): /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in open(self, fullurl, data, timeout) 515 516 sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method()) --> 517 response = self._open(req, data) 518 519 # post-process response /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in _open(self, req, data) 532 533 protocol = req.type --> 534 result = self._call_chain(self.handle_open, protocol, protocol + 535 '_open', req) 536 if result: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 492 for handler in handlers: 493 func = getattr(handler, meth_name) --> 494 result = func(*args) 495 if result is not None: 496 return result /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in https_open(self, req) 1383 1384 def https_open(self, req): -> 1385 return self.do_open(http.client.HTTPSConnection, req, 1386 context=self._context, check_hostname=self._check_hostname) 1387 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1343 encode_chunked=req.has_header('Transfer-encoding')) 1344 except OSError as err: # timeout error -> 1345 raise URLError(err) 1346 r = h.getresponse() 1347 except: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>
답변 2
2
위의 방법이 안될 경우 https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv 에서 다운 받은 다음 pandas로 직접 읽어들이면 될것 같습니다.
import pandas
df = pandas.read_csv('iris.csv')
직접 파일을 받아서 위의 코드로 변환해서 이용하면 될 것 같습니다.
출처 : http://doc.mindscale.kr/km/python/11.html
날짜변환 에러
0
258
0
업로드자료 오류
1
371
1
20강 관련 문의드립니다.
1
299
1
17강 도입부 실습사이트 문의
2
298
1
4강 코드 오류메세지 관련 질의
1
374
2
merge와 그룹바이 관련 질문이 있습니다.
1
494
3
쉬운 도서 추천 좀 부탁드립니다.
2
393
2
1강2강에 있는 csv파일을 다운받으면 한글이 깨져서 나와요
1
251
1
주피터노트북 목록(contents) 만들기
1
632
1
df.loc[df["거주지"].isin(gu), "지역"] = df["거주지"] 질문있습니다
1
207
1
월 주 함꼐 value_counts()
1
223
1
day_count.iloc[i]와 day_count[i]의 차이 질문
1
350
1
df 인덱싱 질문입니다
1
183
1
그래프에 한글제목을 나타내고 싶습니다.
1
535
1
배운 것 기반으로 만들어보고 있는데 질문이 있습니다.
1
404
5
질문이요
1
300
1
set_index()
1
287
1
timeit 관련 질문
1
363
1
그래프 밑에 제목을 넣으려면 어떡해야하나요???
1
421
2
한글폰트 설치 후 나오지 않는 현상 문의
1
1171
3
CSV 파일 불러오기
1
569
1
크롤링으로 csv파일 가져오기
2
316
1
영상에서 소개해주시는 웹사이트
2
257
1
질문
1
227
2






