Search
 
SCRIPT & CODE EXAMPLE
 

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'
Comment

PREVIOUS NEXT
Code Example
Python :: python sort isdigit 
Python :: come traferire file python 
Python :: numpy collapse last dimension 
Python :: how to make turtle shape image smaller 
Python :: python graphviz undirected graph 
Python :: how to write a python script to find the value of x at a given y value 
Python :: idwt pywt 
Python :: arabert 
Python :: anagrams python 
Python :: gtk entry not editable python 
Python :: pysft connection drop issue 
Python :: python writelignes 
Python :: raspberry pi led python 
Python :: check if value exists in list python 
Python :: download pyautogui 
Python :: pyhdb cesu-8 
Python :: colorbar remove tick lines and border 
Python :: python get all items from generator 
Python :: genskill bootcamp amazing python program 
Python :: ordereddict deleting wrong item 
Python :: c++ to python code converter 
Python :: django two foreignkeys to same model admin error 
Python :: TypeError at /admin/auth/user/ 
Python :: Unpacking list using underscore 
Python :: list of words from a string and filter them based on a secondary list 
Python :: pandas set a value in colmns as the maximum value 
Python :: choose custom index pandas 
Python :: python random number generator 
Python :: back of list 
Python :: create schema dynamo revit 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =