728x90
반응형
import pandas as pd
df = pd.read_csv('sample.csv')
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-10-1f009496a509> in <cell line: 1>()
----> 1 df = pd.read_csv('sample.csv')
10 frames
/usr/local/lib/python3.10/dist-packages/pandas/_libs/parsers.pyx in pandas._libs.parsers.raise_parser_error()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc7 in position 0: invalid continuation byte
[ 해결 ]
encoding='cp949' 추가
df = pd.read_csv('sample.csv', encoding='cp949')
728x90
반응형
'개발 > Python' 카테고리의 다른 글
Pandas DataFrame FutureWarning (0) | 2024.03.13 |
---|---|
Pandas reset_index() error (0) | 2024.02.20 |
로또 번호 생성기, 로또 6/45 (0) | 2023.12.15 |
Windows pandas read_csv UnicodeDecodeError (0) | 2023.11.18 |
천 단위 숫자를 컴마(',')로 구분하기 (0) | 2023.06.11 |