Hi
I am also facing the same issue.
I have a dataframe named with columns: label,text
I defined function as below:
Can anyone please help.
Thanks
I am also facing the same issue.
I have a dataframe named with columns: label,text
I defined function as below:
def split_tokens(text): message = text.str.lower() word_tokens = word_tokenize(message) return word_tokensI am applying this function on a new dataframe column as below
imdb['tokenized_message'] = imdb[['text']].apply(split_tokens,axis=1)But when I execute this function I get error with message:
Quote:TypeError: ('expected string or bytes-like object', 'occurred at index 0')
Can anyone please help.
Thanks