title: how to sort dataframe2 according to dataframe1 with fuzzywuzzy
body: <p>I know this is old question in fact i have seen many links related to my question:</p>
  <p><a href="https://stackoverflow.com/questions/37891131/using-fuzzywuzzy-to-create-a-column-of-matched-results-in-the-data-frame">Using fuzzywuzzy to create a column of matched results in the data frame</a></p>
  <p><a href="https://stackoverflow.com/questions/59312265/how-to-compare-a-value-in-one-dataframe-to-a-column-in-another-using-fuzzywuzzy">How to compare a value in one dataframe to a column in another using fuzzywuzzy ratio</a></p>
  <p><a href="https://stackoverflow.com/questions/63221743/whats-the-best-way-to-use-fuzzywuzzy-to-compare-each-value-of-a-column-with-all">What&#39;s the best way to use fuzzywuzzy to compare each value of a column with all the values of a separate dataframe&#39;s column?</a></p>
  <p>But i didnt get any proper solution for this</p>
  <p>below is my code:</p>
  <pre><code>g = [{'column1': 'ryzen 5 5600'},{'column1':'ram 8 gb ddr4 3.2ghz'}, {'column2':'SSD 
                                       220gb'}, {'column3':'windows 10 prof'}, 
                              {'column2':'ryzen 5 3600'}, {'column1':'ram 16 gb ddr4'}]
  
  df1=pd.read_excel('product1.xlsx', header=None, index_col=False)
  s = []
  for l in df1.values:
      l = ', '.join(l)
      s.append(l)
  
  s = ', '.join(s)    
  
  MIN_MATCH_SCORE = 30
  guessed_word = [d for d in g if fuzz.token_set_ratio(s, list(d.values())[0]) &gt;= 30]
  </code></pre>
  <p>product1 contains:</p>
  <pre><code>0   GB ddr4
  1   HDD 256GB
  2   SSD
  3   ryzen 5
  4   Win 10 Pro
  </code></pre>
  <p>guessed_word contains:</p>
  <pre><code>#gives good output
  
  [{'column1': 'ryzen 5 5600'},
   {'column1': 'ram 8 gb ddr4 3.2ghz'}, 
   {'column2': 'SSD 220gb'}, 
   {'column3': 'windows 10 prof'}, 
   {'column2': 'ryzen 5 3600'}, 
   {'column1': 'ram 16 gb ddr4'}]
  </code></pre>
  <p>After appending to dataframe:</p>
  <pre><code>df3 = pd.Dataframe(guessed_word)
  </code></pre>
  <p>df3 contains:</p>
  <pre><code>column1                  column2          column3
       
  ryzen 5 5600             SSD 220gb        windows 10 prof
  ram 8 gb ddr4 3.2ghz     ryzen 5 3600
  ram 16 gb ddr4
  </code></pre>
  <p>But i want following output:</p>
  <pre><code>#product1              column1                                column2          column3
  0   GB ddr4            ram 8 gb ddr4 3.2ghz, ram 16 gb ddr4   NAN               NAN
  1   HDD 256GB          NAN                                    NAN               NAN 
  2   SSD                NAN                                    SSD 220gb               NAN
  3   ryzen 5            ryzen 5 5600                           ryzen 5 3600      NAN
  4   Win 10 Pro         NAN                                    NAN        windows 10 prof
  </code></pre>
  <p>is it possible to sort with df.sort_values or anything ?
  i tried and none of that are working.</p>