使用pivot_table
后,我收到一个DataFrame
,它有一些重复的索引,如下所示:
如果从底部看第二个条目,它只有1memberid
,对应2testscoreid
。在DataFrame
中有一个对应的列,名为ScoreRatio
,我没有在这里显示。我只想用更高的testscoreid
值保留{
数据可以在here中找到。在
我尝试使用以下代码,但似乎没有任何影响:
selectedTestsPivotCorrect.reset_index(level=['memberid'])
selectedTestsPivotCorrect.groupby(selectedTestsPivotCorrect.index).last()
如何对我的DataFrame
中出现的所有重复(或可能的三元组、四元组等)memberid
执行此操作?在
任何建议都将不胜感激。在
目前没有回答
相关问题 更多 >
编程相关推荐