본문 바로가기
Python/Exception

[Python] AttributeError: 'DataFrame' object has no attribute 'tolist'

by 소여물리에 2022. 12. 12.

 

 

데이터 프레임을 리스트로 변경할때 뜨는 에러 메세지

df[col].tolist()
# AttributeError: 'DataFrame' object has no attribute 'tolist'

 

 

해결방법

df[col].values.tolist()

values.tolist() 로 변경하면 된다.

 

 

 

 

 

반응형