0
파이썬 3에서 바이트에서 변환 된 문자열에서 16 진수를 제거해야합니다.바이트를 스팅으로 변환하고 트위터 데이터에서 16 진수를 제거하십시오
바이트에서 문자열로 변환 할 수 있지만 그 다음에 16 진수를 인코딩하거나 자동으로 제거 할 수는 없습니다. ASCII로 인코딩하려고했지만 작동하지 않습니다.
내 텍스트 데이터는 사전 목록에서 키 "tweet_text"아래의 값입니다. 여기
for d in sheet_data:
just_text = d['tweet_text']
print('This is "just_text" type: ', type(just_text))
just_text_strings = str(just_text)
print('This is "just_text_strings" type: ', type(just_text_strings))
just_text_clean = just_text_strings.encode('ascii', errors='ignore')
내 출력 : 가 여기 내 코드입니다 내가 조언이나이 문제를 해결하기 위해 아이디어 하나를 감사
This is "just_text" type: <class 'bytes'>
This is "just_text_strings" type: <class 'str'>
b'b"[/Very seldom~ will someone enter your life] and you won\'t have to question\\xc3\\xa2\\xe2\\x82\\xac\\xc2\\xa6 "'
....이 트위터 데이터는
을하는 데 도움이 경우에서,