inflearn logo
강의

講義

知識共有

Pandas Pandasのデータ分析基礎実習

データフレームを作成する

attributeError가 발생합니다

744

ldskoo12036160

投稿した質問数 1

0

friend_list = [
    ['name', ['John', 'Nate']],
     ['age', [20, 30]],
     ['job', ['student', 'teahcer']]
]


df = pd.DataFrame.from_items(friend_list)


위와 같이 할 경우에 아래와 같이 에러가 발생합니다.

type object 'DataFrame' has no attribute 'from_items'

pandas

回答 1

9

Melody Shin

API 문서 보니까 이렇게 나오네요.

Deprecated since version 0.23.0: from_items is deprecated and will be removed in a future version. Use DataFrame.from_dict(dict(items)) instead. DataFrame.from_dict(OrderedDict(items)) may be used to preserve the key order.

위의 예제에서는 

df = pd.DataFrame.from_dict( dict(friend_list) )

로 수정하면 되더라구요.

1유형 강의 다 나간 후 어떻게 할까요?

0

14

1

점수차가 많이 나는데 따로 하신게 있으신가요?

0

10

1

작업형1 모의문제 4번에 3)문제 질문

0

21

2

이상치 전처리 작업

0

25

2

평가결과값 문의

0

29

2

시계열 데이터 날짜와 시간 format

0

35

2

평가지표 F1 스코어 질문드립니다.

0

27

2

applymap이 더 이상 권장되지 않는다고 하는데요

0

311

1

dataframe append 불가능

0

3226

1

메모리 참조 오류?

0

331

0

if else 오류

0

256

1

행 삽입

0

326

1

github cheetshit파일에 write dataframe to file 이후가 안 보입니다. 전체 파일 볼 수 있는 방법

0

268

1

input을 이용해서 원하는 행 추출

0

314

1

pandas 설치 오류

2

1384

3

컬럼명이 다를 경우 어떻게 합치나요?

0

349

1

df = pd.DataFrame.from_items(...)에서 AttributeError에 대한 추가 질문입니다.

0

660

1

선생님과 학생 나이 변경하는 부분 질문입니다.

0

237

1

filter like

0

356

1

index 질문이요

0

233

1

데이터프레임을 만들 때 딕셔너를 자주 쓰시는 이유가 있나요?

1

228

0

판다스로 생성된 데이터 프레임은 csv로 저장되나요?

0

372

1

future error

0

397

1

pandas.core.base.DataError: No numeric types to aggregate 라는 오류가 발생합니다.

0

319

0