python/pandas

pandas read .txt text 파일 읽기

jin0choi1216 2021. 7. 1. 17:57

text 파일을 읽을 때 read_csv를 사용해서 하는게 좋다.

첫번째 row가 사라져서 나오거나 칼럼이 없다는 에러가 발생 할 수 있다.

 

text_file = pd.read_csv("./text.txt", names = ['column'])