728x90
반응형

Python 3

DataFrame에서 날짜 변환 시 한글(월일) 추가 (+locale error)

날짜 형식을 변환하고 한글(월일)을 넣고 싶은 경우 아래와 같이 에러가 남. df['날짜'] = [i.strftime("%m월 %d일") for i in df['날짜']] >> 'locale' codec can't encode character '\uc6d4' in position 2: encoding error 해결방법1) 모두 적용 #코드추가 import locale print(locale.getlocale()) locale.setlocale(locale.LC_ALL, '') print(locale.getlocale()) 해결방법2) 해당 코드만 적용 df['날짜'] = [i.strftime("%m월 %d일".encode('unicode-escape').decode()).encode().decode(..

Anaconda3 설치 오류

Anaconda3 설치가 안될 때, 아래 두 가지 경우를 생각해 볼 수 있다. 1. 저장경로의 폴더 이름이 한글로 되어 있는 경우 2. Anaconda3 설치 이전 파이썬을 설치했던 경우 1. 저장경로의 폴더 이름이 한글로 되어 있는 경우 아래와 같은 에러 문구가 뜰 경우 저장경로 폴더의 이름이 한글 또는 특수문자가 포함되었는지 잘 살펴보자. Error. Due to incompatibility with several Python libraries, 'Destination Folder' cannot contain non-ascii characters(special characters or diacritics). Please choose another location. 나 같은 경우는 바로 '사용자' 라는..

728x90
반응형