커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
2주차 - 'pandas 기초' 강의 중 질문입니다.
1시간만에 끝내는 직장인 코딩 용어 해설
기타
북마크
주*준
댓글
3
추천
0
조회수
12
조회수
12
답변 완료

import pandas as pd

import numpy as np


data = { 

    'name': {'철수','영희','동희','영수'},

    'age': [15,20,32,40]

}

df = pd.DataFrame(data)


df


리고 입력을 했습니다. 근데 결과가 이렇게 나옵니다. !!!

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-18-ed96ee15e90c> in <module>
      3     'age': [15,20,32,40]
      4 }
----> 5 df = pd.DataFrame(data)


4 frames

/usr/local/lib/python3.7/dist-packages/pandas/core/construction.py in sanitize_array(data, index, dtype, copy, raise_cast_failure, allow_2d)
    557         if isinstance(data, (set, frozenset)):
    558             # Raise only for unordered sets, e.g., not for dict_keys
--> 559             raise TypeError(f"'{type(data).__name__}' type is unordered")
    560 
    561         # materialize e.g. generators, convert e.g. tuples, abc.ValueView

TypeError: 'set' type is unordered


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