커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
repror 입력 시 출력 에러 관련
undefined주차
북마크
신*준
댓글
1
추천
0
조회수
7
조회수
7
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


하단의 코드를 입력했을 때 출력 에러가 뜹니다.


> df[df['repror'] == '김범수'] <




스파르타 즉문즉답

repror 값을 입력하지 않는 태그에서는 값이 잘 출력 됩니다.


스파르타 즉문즉답

그런데, 해당 코드를 입력하면 출력에 에러가 발생합니다.

제가 코드를 잘못 넣은 건가 싶어, 강의 자료에 나와있는 코드를 입력해봐도 똑같은 값이 나옵니다.


왜 그런 걸까요ㅠㅠ



작성한 코드 및 에러 메세지

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3628             try:
-> 3629                 return self._engine.get_loc(casted_key)
   3630             except KeyError as err:
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'repror'
The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
   3629                 return self._engine.get_loc(casted_key)
   3630             except KeyError as err:
-> 3631                 raise KeyError(key) from err
   3632             except TypeError:
   3633                 # If we have a listlike key, _check_indexing_error will raise
KeyError: 'repror'




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴