If I sort a dataframe in descending ortder based on a column. And then drop the duplicates using df.dropDuplicate then which element will be removed? The element which was smaller based on sort?
Asked
Active
Viewed 175 times
0
-
i think yes it should preserve the first and drop the second one i.e. drop the smaller values – Akash Sethi Feb 22 '17 at 05:44
1 Answers
0
DropDuplicate method preserves the first Element and removing the others.
So yes , on descending sort only the largest(based on sort) will be preserved and others removed.

Neetika
- 41,966
- 1
- 11
- 7
-
How can i keep the last element? i can't sort desc without specific column – MasterLuV Jul 30 '19 at 06:02