我正在尝试使用以下代码在pandas专栏中查找某个短语: workfromhome = df.loc[df['Description'].str.contains("work from home",na_libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_lo
我有一个文本列的Pandas dataframe。我想要计算一下本专栏中最常见的短语。例如,从文本中,你可以看到像a very good movie,last night等这样的短语经常出现。我认为有一种定义n-gram的方法,例如,该短语在3到5个单词之间,但我不知道如何定义。import pandas as pd
text = ['this is a very good movie that we watched last night