【发布时间】:2021-11-02 00:15:36
【问题描述】:
df.review:
de la nada mi ya no se escucha
I tried to set it up
It is a good product
目的是删除非英语行。我尝试了this 和this,但都没有工作。以下代码错误地将所有行标记为英文。
from langdetect import detect
df['detect'] = detect(str(df['review']))
for i in df.detect:
if i not in ('en'):
df.drop(i)
【问题讨论】:
标签: python pandas drop non-english