Answers for "drop_duplicates python in order"

2

delete the entire row while remove duplicates with python'

result_df = df.drop_duplicates(subset=['Column1', 'Column2'], keep='first')
print(result_df)
Posted by: Guest on March-04-2022
6

delete the duplicates in python

mylist = ["a", "b", "a", "c", "c"]
mylist = list(dict.fromkeys(mylist))

  print(mylist)
Posted by: Guest on May-19-2020

Python Answers by Framework

Browse Popular Code Answers by Language