I have some strings in my dataframe and I have replaced it.
df2['x'].replace(['APPEAL','AppealNo.','AppealNO.','Co.Appeal','COMP.APPL','Co.Appeal','Comp.','AppealNo','CoAppealnies','CoAppealnies','companyappealno.''CompAPPNo.','CApealNo','CApeal','companyappeal'],'CoAppeal', regex=True,inplace=True)
Is there a way where I can predict the future combinations of strings in python with the given strings so I can replace it without doing the process manually?
CoAppealand returns a list of variations that will likely appear in your data?x, you can compute the distance betweenxand"CoAppeal", and if that distance is small enough, you'll make the replacement. The two are equivalent, in the sense that the list you want is the list of all strings with a small enough distance, but definging the distance function is likely easier than searching all possible strings.