커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
스스로 해결
3-5 DART API 사용해보기
undefined주차
북마크
박*수
댓글
2
추천
0
조회수
20
조회수
20
스스로 해결

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

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


안녕하세요


강의 1분17초에서 결과가 나와야하는데 저는 에러가 발생합니다


도움 부탁 드립니다





스파르타 즉문즉답





작성한 코드 및 에러 메세지

!pip install dart-fss


import dart_fss as dart_fss

import pandas as pd


api_key = 'e1098f833ad0fc51880592bf0aa23f1bb6d33164'

dart_fss.set_api_key(api_key=api_key)


all = dart_fss.api.filings.get_corp_code()


df = pd.DataFrame(all)

df_listed = df[df['stock_code'].notnull()]

df_non_listed = df[df['stock_code'].isnull()]

df_non_listed.head()


corp_co = df_listed[df_listed['corp_name']=='삼성전자'].iloc[0.0]

corp_co


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-29-29ffc1fd96f1> in <module>
----> 1 corp_co = df_listed[df_listed['corp_name']=='삼성전자'].iloc[0.0]
      2 corp_co


1 frames

/usr/local/lib/python3.8/dist-packages/pandas/core/indexing.py in _getitem_axis(self, key, axis)
   1561             key = item_from_zerodim(key)
   1562             if not is_integer(key):
-> 1563                 raise TypeError("Cannot index by location index with a non-integer key")
   1564 
   1565             # validate the location

TypeError: Cannot index by location index with a non-integer key





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