how to remove part of a string after a comma in python code example Example: remove comma from string python column df['x']=df['x'].str.replace(',','')