title: Two Excel files. How to match words in one file to the sentence in the other using python script
body: <p>I have two excel files</p>
  <p>file 1 contains names of different brands ----eg:Audi,BMW,Snickers,Puma,etc</p>
  <p>file 2 contains those brand's product description/some random sentences</p>
  <p>---eg: Audi mainly promotes through sponsorship with automobile races and brands, TV shows, video games and movies.</p>
  <p>Jackson drove a Porsche 911 turbo,etc</p>
  <p>the task is to check whether the brand names of file 1 is there on any sentence of file 2 .if yes then create a new csv file with 2 columns 1)Brand name 2)Respective product description</p>
  <p>Wherever the product name has no brands, print “No Brand Found”.</p>
  <p>this is my code:</p>
  <pre><code>import pandas as pd
  import csv
  dfA = pd.read_excel('product name.xlsx')  
  dfB = pd.read_excel('brands.xlsx')  
  
  b=[]
  for brand in dfB[&quot;Brands&quot;]:
      b.append([brand.lower()])
  
  
  result=[]
  
  for sentence in dfA['Product Name']:
      sentences = sentence.lower()    
      for word in sentences.split():
          if word in b:
               result.append([word,sentences])
  
  with open(&quot;final.csv&quot;,&quot;w&quot;,newline=&quot;&quot;,encoding=&quot;utf-8&quot;) as f:
          writer = csv.writer(f,dialect='excel')
          writer.writerow([&quot;Brand&quot;,&quot;Product Name&quot;])
          writer.writerows(result)
  
  
  f.close() 
  
   
  </code></pre>
  <p>But I'm missing something here because I'm getting an empty final.csv file.</p>
  <p>I hope you got my point also I am a novice in coding</p>