커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
숙제에 에러발생 확안 요청
undefined주차
북마크
이*규
댓글
1
추천
0
조회수
5
조회수
5
답변 완료

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

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


KeyError: "None of [Index(['Open', 'High', 'Low', 'Adj Close', 'Volume'], dtype='object')] are in the [columns]"



스파르타 즉문즉답




작성한 코드 및 에러 메세지

HTTP Error 404: Not Found  - symbol "BRKB" not found or invalid periods
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-108-96d7682af230> in <cell line: 5>()
      3 df = df[['Symbol','Name']].head(100)
      4 
----> 5 df['rate'] = df['Symbol'].apply(final_rate)
      6 

7 cond = df['rate'] > -50


/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in _raise_if_missing(self, key, indexer, axis_name)
   6128                 if use_interval_msg:
   6129                     key = list(key)
-> 6130                 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
   6131 
   6132             not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())

KeyError: "None of [Index(['Open', 'High', 'Low', 'Adj Close', 'Volume'], dtype='object')] are in the [columns]"

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