inflearn logo
강의

Khóa học

Chia sẻ kiến thức

Pandas Pandas Phân tích dữ liệu Thực hành cơ bản

Tạo khung dữ liệu

attributeError가 발생합니다

747

ldskoo12036160

1 câu hỏi đã được viết

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

Câu trả lời 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) )

로 수정하면 되더라구요.

기출 11회 작업형 2_전체 데이터 학습 여부

0

11

1

예측값 결과 소수점 차이

0

16

2

기출 문제와 실전챌린지 연습문제 무엇부터 푸는게 나은가요?

0

13

0

전처리 train() test([ ])

0

14

2

작업형 1 배경지식 질문

0

17

2

옳게 풀은건지 질문드립니다!

0

13

1

roc_auc_score

0

22

2

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

0

320

1

dataframe append 불가능

0

3256

1

메모리 참조 오류?

0

338

0

if else 오류

0

262

1

행 삽입

0

330

1

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

0

269

1

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

0

320

1

pandas 설치 오류

2

1403

3

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

0

353

1

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

0

671

1

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

0

243

1

filter like

0

358

1

index 질문이요

0

237

1

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

1

231

0

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

0

375

1

future error

0

401

1

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

0

322

0