[에러] AttributeError: 'DataFrame' object has no attribute 'split'

프로그래밍/Python|2021. 6. 16. 07:35
반응형

데이터 형식이 다른 text_line 이 있다고 했을때 아래와 같이 실행하면

에러가 출력됩니다.

 

[코드]

text = text_line.split()

print(text)

 

[에러]

AttributeError: 'DataFrame' object has no attribute 'split'

 

[해결]

일반 문자열로 변환 후 처리합니다.

text = str(text_line).split()

print(text)

 

반응형

댓글()