title: ValueError in simple Python calculation
body: <p>This is my function and the variable tracks is a list and each element of the list is a <code>n x 3</code> array:</p>
  
  <pre><code>temp = np.array(np.zeros((n, n)))
  for j in range(n-1):
      for w in range(j + 1, n):  
          mindistance = np.zeros(len(tracks[j]))
          for i in range(len(tracks[j])):   
              mindistance[i] = np.linalg.norm(min(np.fabs(np.array(tracks[w]) - tracks[j][i])))
          temp[j][w]=np.sum(mindistance)/len(tracks[j])
  </code></pre>
  
  <p>I'm trying to calculate the minimum distances between the arrays of the list which represent 3d lines in space but I am getting the error:</p>
  
  <blockquote>
    <p>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().</p>
  </blockquote>
  
  <p>The error is probably related to the call to <code>min()</code> but I can't solve it. Following is the error traceback:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-14-7fb640816626&gt;", line 1, in &lt;module&gt;
      runfile('/Users/G_Laza/Desktop/functions/Main.py', wdir='/Users/G_Laza/Desktop/functions')
  
    File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/widgets/externalshell/sitecustomize.py", line 580, in runfile
      execfile(filename, namespace)
  
    File "/Users/G_Laza/Desktop/functions/Main.py", line 42, in &lt;module&gt;
      tempA = distance_calc.dist_calc(len(subset_A), subset_A)  # distance matrix calculation
  
    File "distance_calc.py", line 23, in dist_calc
      mindistance[i] = np.linalg.norm(min(np.fabs(np.array(tracks[w]) - tracks[j][i])))
  
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>