比方说现在DF表中有一个类别字段’type‘,类别字段’type‘里有100多种类别 由于部分类别的数据量太少,我想清除掉,只留下df.type.value_count()大于100的数据 df.loc[df.type.value_count()>100]会出现报错: IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).查了很多相关的文章,但都解决不了问题 请问大神们怎么操作可以实现我上述的要求
|