Error

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte 오류 해결 방법

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte 오류 해결 방법

    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte 오류 해결 방법 원인 1. Pandas에서 인코딩 하는 방식에 있어서 한글이 포함된 csv, txt, excel 등의 파일을 읽어 들일 때 발생하게 된다. 2. 윈도우즈 경로상에 한글이 포함되어 있을 떄 Flask 실행 시 가끔 오류가 발생한다. 해결 1. 인코딩 인자에 한글 전용 인코딩 방식인 'cp949' 또는 'euc-kr' 을 파라미터로 추가함으로써 해결할 수 있다. import pandas as pd df = pd.read_csv('파일이름.csv', encoding='cp949') import pandas as pd df = pd.r..

    IndentationError: expected an indented block 오류 해결 방법

    IndentationError: expected an indented block 오류 해결 방법

    IndentationError: expected an indented block 오류 해결 방법 원인 IndentationError 는 코드에서 들여쓰기 할 때 탭과 스페이스를 섞어서 사용하게 되면 발생하게 된다. 해결 오류가 발생한 줄의 코드의 들여쓰기 부분을 지웠다가 다시 작성해주면 된다. 오류가 발생한 줄은 빨간색으로 된 오류출력 코드의 끝에 File "~~~", line 13 ^ 으로 된 곳을 보면 된다. 위의 예시에서는 코드의 13번째 줄에서 오류가 난 것을 확인할 수 있다.