次のような文である一連の文字列があります。
Having two illnesses at the same time is known as \xe2\x80\x9ccomorbidity\xe2\x80\x9d and it can make treating each disorder more difficult.
元の文字列を でエンコードし、 python のライブラリ.encode()
で圧縮しました。bz2
その後、解凍しbz2.decompress()
て.decode()
元に戻しました。
これらのバイト文字列をテキストから簡単に削除したり、引用符などの文字が正しくデコードされないようにする方法はありますか?
ありがとう!