I'm trying to use Pyenchant to spell check each entry in a column called pets in a pandas dataframe called house.
import enchant
dict = enchant.Dict("en_US")
for pets in house:
[pets] = dict.suggest([pets])[0]
When I run this code, I get an error about not passing bytestrings to Pyenchant. Not sure what to do. Full error text below:
File "myfile", line 20, in [pets] = dict.suggest([pets])[0] File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/enchant/init.py", line 662, in suggest word = self._StringClass(word) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/enchant/utils.py", line 152, in new raise Error("Don't pass bytestrings to pyenchant") enchant.errors.Error: Don't pass bytestrings to pyenchant
How can I fix this? Thanks.