python similarity and replace function not work -


i have list of cities bad insertion. tried write function solve problem finding similarity between 2 stings. made first step ratio, did not replace anything:

def similar(a, b):         sequencematcher(none, a, b).ratio()         if sequencematcher>=60:           data_city['city'].replace('a','b',inplace=true)           print 

don't quote variable names.

....replace('a','b', ... 

replaces letter 'a' letter 'b', i.e. apple bpple


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -