Tokenizing words into a new column in a pandas dataframe

前端 未结 2 1512
轻奢々
轻奢々 2021-01-28 00:45

I am trying to go through a list of comments collected on a pandas dataframe and tokenize those words and put those words in a new column in the dataframe but I have having an e

2条回答
  •  春和景丽
    2021-01-28 01:27

    Don't you just want to do this:

       df['words'] = df['complaint'].apply(apwords)
    

    you don't need to define the function addwords. Which should be defined as:

    addwords = lambda x: apwords(x)
    

提交回复
热议问题