UnicodeDecodeError: 'cp949' codec can't decode byte 0x94
1719
작성한 질문수 2
--------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-47-9f2a70a6b775> in <module> 2 ## %ls 3 ----> 4 df_last = pd.read_csv(r"D:\인공지능\파이썬교육\data\주택도시보증공사_전국 평균 분양가격(2019년 12월).csv", encoding="cp949") 5 ## df_last.shape C:\Windows\Anaconda3\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision) 674 ) 675 --> 676 return _read(filepath_or_buffer, kwds) 677 678 parser_f.__name__ = name C:\Windows\Anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds) 446 447 # Create the parser. --> 448 parser = TextFileReader(fp_or_buf, **kwds) 449 450 if chunksize or iterator: C:\Windows\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds) 878 self.options["has_index_names"] = kwds["has_index_names"] 879 --> 880 self._make_engine(self.engine) 881 882 def close(self): C:\Windows\Anaconda3\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine) 1112 def _make_engine(self, engine="c"): 1113 if engine == "c": -> 1114 self._engine = CParserWrapper(self.f, **self.options) 1115 else: 1116 if engine == "python": C:\Windows\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds) 1889 kwds["usecols"] = self.usecols 1890 -> 1891 self._reader = parsers.TextReader(src, **kwds) 1892 self.unnamed_cols = self._reader.unnamed_cols 1893 pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.__cinit__() pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._get_header() pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows() pandas\_libs\parsers.pyx in pandas._libs.parsers.raise_parser_error() UnicodeDecodeError: 'cp949' codec can't decode byte 0x94 in position 23: illegal multibyte sequence
답변 4
0
엑셀로 한번 연 이후에는 에러가 나는 것 같습니다. 그냥 다운로드하여 바로 열면 성공입니다.
0
파일은 열었는데, 위와 같이 여전히 decode 에러가 납니다.
0
안녕하세요. 아마도 엑셀등으로 열거나 다운로드 받아 처리하는 과정에서 인코딩 방식이 바뀌었을 것 같습니다. 기존 csv 파일을 삭제하고 다시 다운로드 받아서 해당 폴더에 옮기고 로드해 보시겠어요?
0
안녕하세요.
파일명 뒤에 .csv 가 누락되어 있습니다.
확장자를 대소문자를 맞춰서 작성해 주세요.
그래도 안 된다면 r"경로명.csv" <= 이렇게 따옴표 앞에 r을 써주세요.
r은 raw의 약자로 역슬래시 등의 특수문자에 따라 경로가 잘못 해석되는 것을 방지합니다.
패키지 설치 에러 ydata-profiling
0
134
2
자세한 설명 부탁드려요 ㅜ
0
200
2
seaborn 라이브러리 호출하였으나 그래프가 안 그려져요
0
310
2
value_counts와 count 차이
0
375
2
안녕하세요 데이터 최신과 관련해서 문의드립니다.
0
217
3
scatterplot질문
0
132
1
강의 화면이 안나옵니다
0
174
2
4분12초 2013년부터 데이터가 없으면 어떻게하나요?..
0
193
2
에러 메시지
1
311
2
그래프 색이 동일하게 나옵니다.
0
328
2
시각화 라이브러리 비교
0
400
2
주피터 노트북 설치
0
399
1
2. 상가 기술통계 아웃풋 자료에서 오류가 납니다
0
233
1
14. distplot g = sns.FacetGrid(df_last, row="지역명", height=1.7, aspect=4) g.map(sns.distplot, "평당분양가격", hist=False, rug=True); 오류
0
185
1
group by agg function failed 에러
0
696
2
빈도수가 1000개 이상인 데이터를 따로 담을 때 코드 질문 있습니다.
0
295
2
주피터 노트북 실행 했는데 앞에 *가 생기고 결과가 나오지 않아요
0
372
3
get_string함수에서 문자 'nan'
0
205
1
seaborn X축 시작 지점 조정 질의의 건
0
229
1
14강 distplot 질의
0
299
1
nbextension 설치 및 셋팅 후 적용이 안되는 이슈
0
486
1
corr = df.corr() 입력시 오류
1
383
1
keyword grid_b is not recognized
0
342
1
%ls data 매직커맨드 사용시 한글 깨짐
0
304
1





