• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Python, SQL 게시판 텐서플로우 KeyError 이런 에러가 발생하네요.

텐서플로우 KeyError 이런 에러가 발생하네요.

2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 글쓴이
  • #7002

    Chagon Son
    참가자

    코랩에서 작업하다가 발생한 에러입니다.

    import tensorflow as tf

    정답 = data.pop('Survived')

    ds = tf.data.Dataset.from_tensor_slices( (dict(data), 정답) )

    print(ds)

    <hr />

    --------------------------------------------이런 에러 발생합니다

    KeyError Traceback (most recent call last)

    /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
    2897 try:
    -> 2898 return self._engine.get_loc(casted_key)
    2899 except KeyError as err:

    pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

    pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

    pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

    pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

    KeyError: 'Survived'

    The above exception was the direct cause of the following exception:

    KeyError Traceback (most recent call last)

    4 frames
    /usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
    2898 return self._engine.get_loc(casted_key)
    2899 except KeyError as err:
    -> 2900 raise KeyError(key) from err
    2901
    2902 if tolerance is not None:

    KeyError: 'Survived'

     

    #7006

    codingapple
    키 마스터

    아마 Survived라는 이름의 컬럼이 없다는 에러같은데요 

2 글 보임 - 1 에서 2 까지 (총 2 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠