Hi, I have a sheet for card tip entry. I want to be able to remove duplicate rows (one is entered twice accidentally as it has happened)
Every single entry has a unique ID, so the 2 duplicates would have separate IDs but all other information is identical. The ID is the label of the row.
I'm not sure what you mean by "remove duplicates" but you can use <code>groupby</code> with <code>as_index=False</code> to get a <code>DataFrame</code> with the duplicates removed. <code>df.groupby('ID', as_index=False).first() </code> If you want to just keep one of the two duplicates then you can use <code>drop_duplicates</code> with <code>keep='last'</code> <code>df.drop_duplicates('ID', keep='last') </code>
User | Count |
---|---|
41 | |
31 | |
29 | |
16 | |
14 |