Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5장 오류 질문입니다 #140

Open
cheesss opened this issue Feb 25, 2022 · 1 comment
Open

5장 오류 질문입니다 #140

cheesss opened this issue Feb 25, 2022 · 1 comment

Comments

@cheesss
Copy link

cheesss commented Feb 25, 2022

올려주신 네이버 웹스크롤 가능한 코드로 했는데 이런식으로 뜹니다.
혹시 조언해주실 수 있나요?

Traceback (most recent call last):
File "C:\Users\chohjender\anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3361, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'code'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "c:\myPackage\cho_DBUpdater.py", line 161, in
dbu = DBUpdater()
File "c:\myPackage\cho_DBUpdater.py", line 41, in init
self.update_comp_info()
File "c:\myPackage\cho_DBUpdater.py", line 57, in update_comp_info
self.codes[df['code'].values[idx]]=df['company'].values[idx] #�о�� ���̺��� �̿��� codes ��ųʸ��� �����.
File "C:\Users\chohjender\anaconda3\lib\site-packages\pandas\core\frame.py", line 3458, in getitem
indexer = self.columns.get_loc(key)
File "C:\Users\chohjender\anaconda3\lib\site-packages\pandas\core\indexes\base.py", line 3363, in get_loc
raise KeyError(key) from err
KeyError: 'code'

@INVESTAR
Copy link
Owner

HediSQL로 mariaDB에 접속하셔서 아래 사항을 확인해 보시기 바랍니다.

  1. company_info 테이블의 code 컬럼명이 소문자 code가 맞는지
  2. investar 데이터베이스의 인코딩 방식이 utf8_general_ci로 설정되어 있는지
CREATE TABLE IF NOT EXISTS company_info (
code VARCHAR(20),
company VARCHAR(40),
last_update DATE,
PRIMARY KEY (code)
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants