SyntaxFix
Write A Post
Hire A Developer
Questions
Created the Data frame:
import pandas as pd dk=pd.DataFrame({"BrandName":['A','B','ABC','D','AB'],"Specialty":['H','I','J','K','L']})
Now use DataFrame.replace() function:
DataFrame.replace()
dk.BrandName.replace(to_replace=['ABC','AB'],value='A')