title: Comparison two values from two different classes "<class 'pydicom.valuerep.DSfloat'>" and <class 'numpy.ndarray'> in Python
body: <p>I want to compare some values using "if" in the code below, but it doesn't work:</p>
  
  <pre><code>if Slice_num[person][i, [1]] == Z_pos:   # Slice_num[0][15, [1]] is ['-10.000000'] and Z_pos = -10.000000 
      absname = os.path.join(root, dcmfile)
  </code></pre>
  
  <hr>
  
  <p>Example: Values in the above variables are equal:</p>
  
  <pre><code>Z_pos: -10.000000 , &lt;class 'pydicom.valuerep.DSfloat'&gt;
  Slice_num[person][i, [1]]: ['-10.000000'] , &lt;class 'numpy.ndarray'&gt;
  </code></pre>
  
  <p>So, when the code is performed, <code>if</code>statement cannot be applied and the next line after <code>if</code>statement cannot be run. while the value (-10.000000) is same in both of them.
  How can the problem be solved, so that <code>if</code>statement find them equal?</p>