커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2주차 숙제 balancesheet.loc 질문
undefined주차
북마크
지*현
댓글
3
추천
0
조회수
17
조회수
17
답변 완료

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

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


balancesheet에서 'Cash' 만 뜨게 하는거 코드 입력하는데 오류가 나요






company = yf.Ticker('GOOG')
df = company.balance_sheet.loc[['Cash']]
df

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-74-0d82f748bd1b> in <module>
      1 company = yf.Ticker('GOOG')
----> 2 df = company.balance_sheet.loc[['Cash']]
      3 df


4 frames
/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py in _validate_read_indexer(self, key, indexer, axis)
   1372                 if use_interval_msg:
   1373                     key = list(key)
-> 1374                 raise KeyError(f"None of [{key}] are in the [{axis_name}]")
   1375 
   1376             not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique())

KeyError: "None of [Index(['Cash'], dtype='object')] are in the [index]"



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