Pandy: upuszczaj kolejne duplikaty
Jaki jest najbardziej skuteczny sposób na upuszczenie tylko kolejnych duplikatów w pandach?
drop_duplicates daje to:
In [3]: a = pandas.Series([1,2,2,3,2], index=[1,2,3,4,5])
In [4]: a.drop_duplicates()
Out[4]:
1 1
2 2
4 3
dtype: int64
Ale chcę tego:
In [4]: a.something()
Out[4]:
1 1
2 2
4 3
5 2
dtype: int64