【发布时间】:2021-10-19 00:13:00
【问题描述】:
我已经尝试了很多组合如何从数据框中删除这个空列表,但没有奏效。
index_names = self.df[self.df['stopwords'].len()==0].index
self.df.drop(index_names, inplace=True)
名为 df['stopwords'] 的数据框看起来像这样
目标是用 [] 列表删除数据框的整行
【问题讨论】:
-
df = df.loc[df['stopwords'].ne([])]? -
这是否等于删除那些空列表? @Ch3steR
-
enter link description here 这应该找到所有空列表并删除它们
标签: python python-3.x pandas list dataframe