Error code 모음/4. Python errors
[Python Error] TypeError: expected string or bytes-like object
쟈누
2021. 3. 18. 15:42
반응형
1. 에러 원인
정규식을 사용했을 때 타입(type)이 맞지 않으면 해당 에러 발생
2. 해결방법
올바른 형태로 형변환을 해준다.
나의 경우에는 str 을 넣어야 되는데 list 를 계속 넣어주고 있어서 에러가 발생..
words = re.sub('[-=+,#/\?:^$.@*\"※~&%ㆍ!』\\‘|\(\)\[\]\<\>`\'…》]', '', str(texts))
3. 참고 링크
soraji.github.io/python/2019/07/21/rex/
[python] 파이썬 TypeError: expected string or bytes-like object
TypeError: expected string or bytes-like object
soraji.github.io
반응형