python - Append dataframe in nested loop in pandas -


i have 2 dataframes dfnew , dfrest , using them in nested loop below, , new dataframe newtempdf = pd.dataframe().

i want collect entries of z when m> 70 in newtempdf

also, how can join in better way?

for x, y in dfnew.iterrows():     dfrestnew = dfrest[dfrest['zip'].isin([y[4],'blank'])]     = str(y['companyname'])+' '+str(y['address'])+' '+str(y['city'])+' '+str(y['state'])+' '+str(y['zip'])     = i.lower()     x1, z in dfrestnew.iterrows():         m = 0         j = str(z['companyname'])+' '+str(z['address'])+' '+str(z['city'])+' '+str(z['state'])+' '+str(z['zip'])         j = j.lower()         score = fuzz.ratio(i, j)         if score>=m:             m = score         if m> 70:             # how append in newtempdf?? 

sample df ((sep=',') easier formatting):

companyname,address,city,state,zip,country austin cake studio,1504 chisholm trl,round rock,tx,78681,us magee's bakery,8188 orangeburg rd,maysville,ky,41056,us sweet shoppe,1200 kay dr, olney,tx,76374,us 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -