I would like to only populate one of the duplicate record but with number of duplicates like below.
How can do this or what is the best way to achieve this with python?
well_id Dup
D36528 3
D36528
D36528
D36532 2
D36532
D36521
D36522
D36525 2
D36525
Solved! Go to Solution.
I like your's best Joshua, nice and clean
The Counter object was purpose built for situations like this. Granted, it is fairly easy to implement with a dict or defaultdict, but there are some handy performance and syntax optimizations using the custom object.
I see that now -- I googled the Counter object right after reading your post. I am going to add it to my python toolbox.