title: Unsupported operand type(s) for *: map and map
body: <p>I am trying to debug the following code where I get the aforementioned error message: TypeError: unsupported operand type(s) for *: 'map' and 'map'</p>
  
  <p>I did my fair search online and I understand that the square operation is not supported but I cannot fully understand how to resolve it.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>mahalanobis = lambda p: distance.mahalanobis(p, means, covariances.T)
  d = np.array(map(mahalanobis, data))  # Mahalanobis distance values 
  d2 = d ** 2  # MD squared
  </code></pre>
  
  <p>The error pops up in the square calculation. All data types are numpy.ndarrays.</p>