커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3-6 코드 중 뭐가 잘못되었나요?
undefined주차
북마크
이*연
댓글
1
추천
0
조회수
12
조회수
12
답변 완료

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

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


수업 내용 그대로 따라한것 같은데 아래 코딩 중 뭐가 잘못되었나요?



보고 계신

스파르타 즉문즉답

화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.




작성한 코드 및 에러 메세지


def get_salary(name):

  corp_code = df_listed[df_listed['corp_name'] == 'name'].iloc[0,0]

  data = dart_fss.api.info.indvdl_by_pay(corp_code, '2021', '11011')




  df = pd.DataFrame(data['list'])




  df = df[['corp_name', 'nm', 'ofcps', 'mendng_totamt']]




  df.columns = ['기업명', '이름', '역할', '보수']

          

  df['보수'] = pd.to_numeric(df['보수'].str.replace(',','')) 




  return df






get_salary('카카오')


IndexError                                Traceback (most recent call last)
<ipython-input-98-3f47f0fe4478> in <cell line: 1>()
----> 1 get_salary_top('카카오')


2 frames

/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py in _get_value(self, index, col, takeable)
   3913         if takeable:
   3914             series = self._ixs(col, axis=1)
-> 3915             return series._values[index]
   3916 
   3917         series = self._get_item_cache(col)

IndexError: index 0 is out of bounds for axis 0 with size 0




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