Answers for "drop duplicates pandas considering lowercase"

0

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'
Posted by: Guest on May-27-2020

Code answers related to "drop duplicates pandas considering lowercase"

Python Answers by Framework

Browse Popular Code Answers by Language