title: How do I fix this error. It looks like a type error, but I'm pretty sure that the arrays are of the same type
body: <p>How to fix this error?</p>
  <pre><code>UFuncTypeError: ufunc 'equal' did not contain a loop with signature matching types (dtype('&lt;U1'), dtype('&lt;U1')) -&gt; dtype('bool')
  </code></pre>
  <p>Here is the code:</p>
  <pre><code>print(y[0:4], len(y))
  print(outs[0:4], len(outs))
  corrects = np.equal(outs.astype(str), y.astype(str), casting=&quot;safe&quot;)
  </code></pre>
  <p><code>outs</code> and <code>y</code> are both numpy arrays of the same length and type. The printed output is:</p>
  <pre><code>['1' '1' '1' '1'] 140
  ['1' '1' '1' '1'] 140
  </code></pre>
  <p>It really seems like the two arrays are the same type, so I'm really stumped on this.</p>