[英]How can I count words based on the column?
你好。 我卡在這里。 你能告訴我如何根據第二列的標簽來計算單詞嗎?
我想使用分類查找最常用的單詞 using.most_common():VB(動詞)中最多 10 個,名詞中最多 10 個。
闡明 Ari Cooper-Davis 的建議:
pos.loc[pos.tag == 'VBN'].word.value_counts()
pos.loc[pos.tag == 'TO'].word.value_counts()
etc.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.