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

javascript - Confirm a form & display message if form is valid with JQuery -

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

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -