один столбец в пандах. В Dataframe содержится текстовая информация, я хотел бы собрать их вместе как фрагмент текста для дальнейшей NLTK.
т.е.
book lines
0 dracula The Project Gutenberg EBook of Dracula, by Br...
1 dracula \n
2 dracula This eBook is for the use of anyone anywhere a...
3 dracula almost no restrictions whatsoever. You may co...
4 dracula re-use it under the terms of the Project Guten...
, за которым следует мой код
list_of_words = [i.lower() for i in wordpunct_tokenize(data[0]['lines']) if i.lower() not in stop_words and i.isalpha()]
и получил ошибку
Traceback (most recent call last):
File "<ipython-input-267-3bb703816dc6>", line 1, in <module>
list_of_words = [i.lower() for i in wordpunct_tokenize(data[0]['Injury_desc']) if i.lower() not in stop_words and i.isalpha()]
File "C:\Users\LIUX\AppData\Local\Continuum\anaconda3\lib\site-packages\nltk\tokenize\regexp.py", line 131, in tokenize
return self._regexp.findall(text)
TypeError: expected string or bytes-like object