Count number of words per row

后端 未结 4 1020
既然无缘
既然无缘 2020-11-29 08:32

I\'m trying to create a new column in a dataframe that contains the word count for the respective row. I\'m looking to the total number of words, not frequencies of each di

4条回答
  •  一整个雨季
    2020-11-29 09:03

    With list and map data from cold

    list(map(lambda x : len(x.split()),df.col))
    Out[343]: [4, 3, 2]
    

提交回复
热议问题