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

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

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


각각 하면 데이터가 나오는데 왜 표로 쌓이지 않을까요?






작성한 코드 및 에러 메세지

def get_salary_both(name) :

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

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


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

    df = df[['corp_name','sexdstn','jan_salary_am']]


    df_result = pd.DataFrame()

    doc = {

        '기업명':name,

        '연봉(남)' : df[df['sexdstn']=='남'].iloc[-1,-1],

        '연봉(여)' : df[df['sexdstn']=='여'].iloc[-1,-1]

    }

    df_result = df_result.append(doc,ignore_index=True)

    return df_result


names = ['삼성전자','LG에너지솔루션','SK하이닉스','NAVER','삼성바이오로직스','삼성전자우','카카오','삼성SDI','현대차','LG화학','기아','POSCO홀딩스','KB금융','카카오뱅크','셀트리온','신한지주','삼성물산','현대모비스','SK이노베이션','LG전자','카카오페이','SK','한국전력','크래프톤','하나금융지주','LG생활건강','HMM','삼성생명','하이브','두산중공업','SK텔레콤','삼성전기','SK바이오사이언스','LG','S-Oil','고려아연','KT&G','우리금융지주','대한항공','삼성에스디에스','현대중공업','엔씨소프트','삼성화재','아모레퍼시픽','KT','포스코케미칼','넷마블','SK아이이테크놀로지','LG이노텍','기업은행']


dfs = []


for name in names:

  try:

    df = get_salary_both(name)

    dfs.append(df)

  except:

    print(f'없음 - {name}')


    df_rustlt = pd.concat(dfs)


df_result

=======================

<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 삼성전자우
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 현대차
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 삼성물산
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - SK
없음 - 한국전력
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 두산중공업
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - KT&G
없음 - 우리금융지주
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 현대중공업
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - 삼성화재
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
없음 - KT
없음 - 포스코케미칼
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)
<ipython-input-34-af82d35a58b3>:14: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  df_result = df_result.append(doc,ignore_index=True)

기업명연봉(남)연봉(여)연봉(남-여)평균0카카오217000000108000000109000000162500000.0



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