title: Python Record Linkage Toolkit - Qgrams Error
body: <p>I have been following the example record linking code from the Python <a href="https://recordlinkage.readthedocs.io/en/latest/notebooks/link_two_dataframes.html" rel="nofollow noreferrer">Record Linkage Toolkit</a> package and it runs fine when using the 'jarowinkler' string matching method. However when running with method = &quot;qgram&quot; or &quot;cosine&quot; it throws a numpy error. Any thoughts on what may be causing the error?</p>
  <blockquote>
  <p>File
  &quot;C:\ProgramData\Anaconda3\lib\site-packages\recordlinkage\compare.py&quot;,
  line 153, in _compute_vectorized
  c = c.where((c &lt; self.threshold) | (pandas.isnull(c)), other=1.0)</p>
  <p>AttributeError: 'numpy.ndarray' object has no attribute 'where'</p>
  </blockquote>
  <p>Code for Reference:</p>
  <pre><code>import recordlinkage
  from recordlinkage.datasets import load_febrl1
  
  ##### Functions Correctly
  
  dfA = load_febrl1()
  
  # Indexation step
  indexer = recordlinkage.Index()
  indexer.block(left_on='given_name')
  candidate_links = indexer.index(dfA)
  
  compare_cl = recordlinkage.Compare()
  
  compare_cl.string('surname', 'surname', method='jaro', threshold=0.1, label='surname')
  
  features = compare_cl.compute(candidate_links, dfA)
  matches = features[features.sum(axis=1) &gt; 0]
  print(len(matches))
  
  ##### Fails with:
  #     AttributeError: 'numpy.ndarray' object has no attribute 'where'
  
  dfA = load_febrl1()
  
  # Indexation step
  indexer = recordlinkage.Index()
  indexer.block(left_on='given_name')
  candidate_links = indexer.index(dfA)
  
  compare_cl = recordlinkage.Compare()
  
  compare_cl.string('surname', 'surname', method='qgram', threshold=0.1, label='surname')
  
  features = compare_cl.compute(candidate_links, dfA)
  matches = features[features.sum(axis=1) &gt; 0]
  print(len(matches))
  </code></pre>