Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

drop duplicates pandas considering lowercase

result_df = df.apply(lambda x: x.astype(str).str.lower()).drop_duplicates(subset=['Column1', 'Column2'], keep='first')

print(result_df)
  Column1   Column2 Column3
0   'cat'     'bat'   'xyz'
1   'toy'  'flower'   'abc'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #drop #duplicates #pandas #lowercase
ADD COMMENT
Topic
Name
9+5 =