You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception occured : 'DataFrame' object has no attribute 'append'
Exception occured : 'DataFrame' object has no attribute 'append'
Exception occured : 'DataFrame' object has no attribute 'append'
Traceback (most recent call last):
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 169, in
dbu.execute_daily()
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 147, in execute_daily
self.update_daily_price(pages_to_fetch)
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 129, in update_daily_price
df = self.read_naver(code, self.codes[code], pages_to_fetch)
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 85, in read_naver
html = BeautifulSoup(requests.get(url,
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1007, in _send_output
self.send(msg)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 947, in send
self.connect()
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 184, in connect
conn = self._new_conn()
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 156, in _new_conn
conn = connection.create_connection(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
Exception occured : 'DataFrame' object has no attribute 'append'
이게 계속 출력되는 것을 보면 아마
def read_naver(self, code, company, pages_to_fetch)이 함수에서
except Exception as e:
print('Exception occured :', str(e))
return None
이 예외처리가 되는 것 같은데 어떻게 해결해야 할까요?
IDE 환경은 VS code
나머지 라이브러리와 파이썬 버전은 교재에 기재되어있는 것과 같은 버전입니다.
코드는 올려주신 DBUpdaterEX.py 입니다.
The text was updated successfully, but these errors were encountered:
데이터프레임.append()가 데이터프레임을 세로 축 방향으로만 합칠 수 있다면,
pandas.concat()은 데이터프레임을 세로 뿐만 아니라 가로 축 방향으로도 합칠 수 있기 때문에
데이터프레임.append() 대신 pandas.concat()을 사용하도록 유도하는 것 같습니다.
데이터프레임.append(데이터프레임) 코드를 pd.concat( [데이터프레임, 데이터프레임] ) 코드로 변경해 주시기 바랍니다.
Exception occured : 'DataFrame' object has no attribute 'append'
Exception occured : 'DataFrame' object has no attribute 'append'
Exception occured : 'DataFrame' object has no attribute 'append'
Traceback (most recent call last):
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 169, in
dbu.execute_daily()
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 147, in execute_daily
self.update_daily_price(pages_to_fetch)
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 129, in update_daily_price
df = self.read_naver(code, self.codes[code], pages_to_fetch)
File "c:/Users/duddn/OneDrive/바탕 화면/updater.py", line 85, in read_naver
html = BeautifulSoup(requests.get(url,
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen
httplib_response = self._make_request(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 1007, in _send_output
self.send(msg)
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 947, in send
self.connect()
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 184, in connect
conn = self._new_conn()
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\connection.py", line 156, in _new_conn
conn = connection.create_connection(
File "C:\Users\duddn\AppData\Local\Programs\Python\Python38\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
Exception occured : 'DataFrame' object has no attribute 'append'
이게 계속 출력되는 것을 보면 아마
def read_naver(self, code, company, pages_to_fetch)이 함수에서
except Exception as e:
print('Exception occured :', str(e))
return None
이 예외처리가 되는 것 같은데 어떻게 해결해야 할까요?
IDE 환경은 VS code
나머지 라이브러리와 파이썬 버전은 교재에 기재되어있는 것과 같은 버전입니다.
코드는 올려주신 DBUpdaterEX.py 입니다.
The text was updated successfully, but these errors were encountered: