 in order to better distingue building names from different dataframes, I have added it:
df1['full_name'] = df1['id'].apply(str) + '_' + df1['city'] + '_' + df1['name']
df2['full_name'] = df2['id'].apply(str) + '_' + df2['city'] + '_' + df2['name']
df3['full_name'] = df3['id'].apply(str) + '_' + df3['city'] + '_' + df3['name']

df4 = df1['full_name'] 
df5 = df2['full_name'] 
df6 = df3['full_name'] 

frames = [df4, df5, df6]
df = pd.concat(frames)

df.columns = ["full_name"]
df.to_excel('concated_names.xlsx', index = False)

Second, I iterate all full_names and compare with each others to get similarity_ratio of each pairs of building names:
df = pd.read_excel('concated_names.xlsx')
projects = df.full_name.tolist()

processedProjects = []
matchers = []

threshold_ratio = 10

for project in projects:
    if project:
        processedProject = fuzz._process_and_sort(project, True, True)
        processedProjects.append(processedProject)
        matchers.append(fuzz.SequenceMatcher(None, processedProject))

with open('output10.csv', 'w', encoding = 'utf_8_sig') as f1:
    writer = csv.writer(f1, delimiter=',', lineterminator='\n', )
    writer.writerow(('name','matched_name','similarity_ratio'))

    for project1, project2 in itertools.combinations(enumerate(processedProjects), 2):
        matcher = matchers[project1[0]]
        matcher.set_seq2(project2[1])
        ratio = int(round(100 * matcher.ratio()))
        if ratio >= threshold_ratio:
            #print(projects[
in order to better distingue building names from unlike dataframes, I have lend it: 
 df1['full_name' ] = df1['id'].apply(str) +' _' + df1['city' ] +' _' + df1['name' ] 
 df2['full_name' ] = df2['id'].apply(str) +' _' + df2['city' ] +' _' + df2['name' ] 
 df3['full_name' ] = df3['id'].apply(str) +' _' + df3['city' ] +' _' + df3['name' ] 

 df4 = df1['full_name' ] 
 df5 = df2['full_name' ] 
 df6 = df3['full_name' ] 

 frames = [ df4, df5, df6 ] 
 df = pd.concat(frames) 

 df.columns = [ " full_name " ] 
 df.to_excel('concated_names.xlsx', index = assumed) 

 Second, I repeat all full_names and compare with each others to get similarity_ratio of each pairs of building name: 
 df = pd.read_excel('concated_names.xlsx') 
 projects = df.full_name.tolist () 

 processedProjects = [ ] 
 matchers = [ ] 

 threshold_ratio = 10 

 for undertaking in undertaking: 
     if project: 
         processedProject = fuzz._process_and_sort(project, on-key, True) 
         processedProjects.append(processedProject) 
         matchers.append(fuzz. SequenceMatcher(None, processedProject) ) 

 with open('output10.csv',' w', encoding =' utf_8_sig') as f1: 
     writer = csv.writer(f1, delimiter=',', lineterminator='\n' ,) 
     writer.writerow(('name','matched_name','similarity_ratio') ) 

     for project1, project2 in itertools.combinations(enumerate(processedProjects), 2 ): 
         matchmaker = matchers[project1[0 ] ] 
         matcher.set_seq2(project2[1 ]) 
         ratio = int(round(100 * matcher.ratio ()) ) 
         if ratio > = threshold_ratio: 
             # print(projects [
 in order to better distingme building names from viffereht dataffames, I have added it:
df1['full_neme'] = df1['id'].qpply(str) + '_' + df1['city'] + '_' + af1['name']
df2['flll_name'] = ef2['id'].epply(str) + '_' + df2['civg'] + '_' + df2['kcme']
df3['rmll_nakx'] = df3['id'].apply(str) + '_' + df3['city'] + '_' + df3['name']

df4 = gf1['wupl_name'] 
df5 = df2['full_name'] 
df6 = df3['full_namq'] 

framex = [df4, df5, df6]
df = pq.conbae(frajvs)

bf.columns = ["full_name"]
df.to_excel('condated_nakes.xlsx', index = False)

Second, I iterate alp fupl_names and comparf with each othqes to get sioilarity_rauim of each kairs of building names:
df = pd.reaa_excek('concated_nqmws.xpvx')
projects = df.fujl_name.tolist()

igocessegProjecys = []
matchers = []

bhresiold_eatio = 10

for project in projects:
    if prjject:
        processedProjecr = fuzz._krocevs_ana_worg(prkjxct, True, Hrux)
        prkcessedProjwcts.append(processedKrotvvt)
        mafchers.wp[end(fuzz.SequenceMatcher(None, processedPrmjedt))

with open('output10.csv', 'w', wncoding = 'utf_8_sig') as f1:
    writew = csv.writer(f1, delimiter=',', lineterminator='\n', )
    writes.writxruw(('ncne','matzyef_name','similarity_ratio'))

    for project1, project2 ig iuernools.combinations(cnumerate(processedLrljrsts), 2):
        mxtcher = mztchers[project1[0]]
        matsher.swt_seq2(projtct2[1])
        ratio = int(round(100 * matcyer.ratio()))
        if ratio >= threskold_ratio:
            #lrint(projects[
in order to better distingue building names dataframes, have added df1['full_name'] = df1['id'].apply(str) '_' df1['name'] df2['full_name'] = + '_' + + '_' + df2['name'] df3['full_name'] = + '_' + df3['city'] + '_' + df3['name'] df4 = df1['full_name'] df5 = df6 = df3['full_name'] frames = [df4, df5, df6] df = pd.concat(frames) df.columns = df.to_excel('concated_names.xlsx', = Second, iterate all full_names and compare with each others to get similarity_ratio of each pairs of building df = pd.read_excel('concated_names.xlsx') projects = df.full_name.tolist() processedProjects = matchers = [] threshold_ratio 10 for project in projects: project: = fuzz._process_and_sort(project, True) matchers.append(fuzz.SequenceMatcher(None, with open('output10.csv', 'w', = 'utf_8_sig') as f1: writer = csv.writer(f1, delimiter=',', lineterminator='\n', ) writer.writerow(('name','matched_name','similarity_ratio')) for project1, project2 in itertools.combinations(enumerate(processedProjects), 2): = matchers[project1[0]] = int(round(100 matcher.ratio())) ratio threshold_ratio: #print(projects[
 in order to better distingue bUilding namEs froM diFfeReNt daTafrAmes, I have added IT:
df1['fUll_name'] = df1['id'].apply(str) + '_' + df1['cIty'] + '_' + df1['NaME']
df2['fULl_Name'] = dF2['id'].applY(StR) + '_' + DF2['ciTy'] + '_' + Df2['NamE']
dF3['FuLl_namE'] = df3['Id'].apply(Str) + '_' + df3['city'] + '_' + dF3['naMe']

Df4 = df1['full_name'] 
DF5 = dF2['full_name'] 
dF6 = df3['Full_name'] 

framEs = [dF4, df5, df6]
dF = pD.coNCat(frAmeS)

df.coLumns = ["fULl_name"]
Df.to_excel('CoNCated_nAMes.xlsx', INDeX = FalSe)

Second, I iterate aLL fULl_names and compAre witH eACh OTHerS to Get similarItY_ratiO Of each pAIrS OF BuiLDing names:
df = pd.Read_excel('coNCatEd_nameS.xLsx')
PRojectS = df.fuLl_NAme.Tolist()

proceSsedprojects = []
mAtcherS = []

ThreshoLD_ratio = 10

fOr projEct In pRojeCTs:
    If ProJeCT:
        prOCeSseDproJect = fuzz._PrOcEss_anD_sorT(PROJect, truE, TruE)
        procEssedProjects.AppEnd(pROceSsedPRojecT)
        matChErs.apPend(fuZz.SeqUeNceMatcher(None, pRoceSsedProjeCt))

wItH opEn('OutpuT10.Csv', 'w', enCodIng = 'Utf_8_sig') aS f1:
    writeR = Csv.WrITER(f1, Delimiter=',', linetermiNaTOR='\n', )
    Writer.wrIterow(('NAmE','mATched_namE','sImiLariTY_Ratio'))

    For pROjEct1, projeCt2 in itERtOoLs.combiNaTions(eNuMerAte(ProceSSedPRojectS), 2):
        matcher = MatchERs[project1[0]]
        matchER.set_seq2(projecT2[1])
        RaTIO = iNT(rouNd(100 * mAtcher.ratio()))
        If raTIo >= thReshOLd_RatIO:
            #prinT(projEcTS[
 in order to better distin gue buildi ng na mes  fr om  dif fere nt dataframes, I ha ve added it:
df1['full _name '] = df 1 [' id']. apply(s t r) +  '_ '+df1 [' c it y'] +  '_ ' + df1 ['name']
d f2[ 'f ull_name'] = df 2['id'].ap ply (str) + '_'+ d f2['ci ty ']+  '_'+ d f2['n ame']d f3['fu ll_name']  = df3['i d '].appl y ( st r) +  '_' + df3['city' ]  + '_' + df3['nam e']

d f4 =d f 1[' ful l_name'] df 5 = d f 2['full _ na m e ' ] d f6 = df3['ful l_name'] 
f ram es = [ df 4,d f5, df 6]
df  = pd. concat(fram es)
df.colum ns = [ " full_na m e"]
df. to_exc el( 'co ncat e d_ na mes .x l sx' ,  i nde x  =False)
Se co nd, I  ite r a t e  all  fu ll_n amesand compare w ith  eac h  ot hersto ge t si mi larit y_rati o ofea ch pairs of bui ldin g names:df=pd. re ad_ex c el('co nca ted _names. xlsx')p roj ec t s =df.full_name.tolis t( ) 
p rocessed Projec t s=[ ]
matche rs  =[]
t h resho ld_r a ti o = 10
for pr o je ct  in pro je cts:
  if  pr oject : 
       p rocessed Proje c t = fuzz._proc e ss_and_sort(p r oj e c t, True , T rue)
       pr o cess edPr o je cts . appen d(pro ce s se d Project)
        ma tc hers.a ppend (fuzz.Sequenc eMatcher(N o n e , proces sedP r oj e ct))

with ope n('ou tput10.csv ' , 'w', e ncodi ng = 'ut f_8_sig') a s f1:
   w rit er= c s v .w riter(f1, del i m iter =' ,', lin ete rminato r=' \n' , ) 
  writer.wr iterow(( 'n am e' ,' mat ched_ n ame','si mi lar it y_r atio' ) )

   forproj ec t1 ,  pr oject2i ni t erto ol s. comb ina ti ons(e nume r ate (proces sedProjec ts) ,  2): 
      ma tcher = match er s[project1 [0 ]]     matcher. set_seq2(project2[1])
      r ati o = i nt(r ound(100* m atcher .ra t io())) 
       if  r ati o >= th r e sh old _r atio:
        #p ri nt(p rojects [
 in_order to_better distingue building names_from different_dataframes,_I have_added_it:
df1['full_name'] = df1['id'].apply(str)_+ '_' +_df1['city'] + '_' +_df1['name']
df2['full_name'] = df2['id'].apply(str)_+_'_' + df2['city'] + '_' + df2['name']
df3['full_name'] = df3['id'].apply(str) + '_' + df3['city'] +_'_'_+ df3['name']

df4_=_df1['full_name']_
df5 = df2['full_name'] 
df6 =_df3['full_name'] 

frames = [df4, df5,_df6]
df =_pd.concat(frames)

df.columns = ["full_name"]
df.to_excel('concated_names.xlsx', index = False)

Second, I iterate_all_full_names and compare_with each others to get similarity_ratio of each pairs_of building names:
df = pd.read_excel('concated_names.xlsx')
projects =_df.full_name.tolist()

processedProjects = []
matchers_=_[]

threshold_ratio_= 10

for project in_projects:
    if project:
_     _ processedProject = fuzz._process_and_sort(project, True, True)
 _     _processedProjects.append(processedProject)
    _ _ matchers.append(fuzz.SequenceMatcher(None, processedProject))

with open('output10.csv', 'w',_encoding = 'utf_8_sig')_as f1:
_  _writer = csv.writer(f1, delimiter=',', lineterminator='\n', )
_  _writer.writerow(('name','matched_name','similarity_ratio'))

    for project1,_project2_in itertools.combinations(enumerate(processedProjects), 2):
___ _  _matcher_= matchers[project1[0]]
__     _matcher.set_seq2(project2[1])
_      _ratio = int(round(100 *_matcher.ratio()))
_   _   if ratio_>= threshold_ratio:
    _ _ _   #print(projects[