pandas :独特的数据框 [英] Pandas: unique dataframe
本文介绍了 pandas :独特的数据框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个具有重复行的DataFrame.我想获得一个具有唯一索引且没有重复项的DataFrame.可以丢弃重复的值.这可能吗?可以通过groupby
完成吗?
I have a DataFrame that has duplicated rows. I'd like to get a DataFrame with a unique index and no duplicates. It's ok to discard the duplicated values. Is this possible? Would it be a done by groupby
?
推荐答案
In [29]: df.drop_duplicates()
Out[29]:
b c
1 2 3
3 4 0
7 5 9
这篇关于 pandas :独特的数据框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文