title: Max Distance between 2 points in a data set and identifying the points
body: <p>I have a matrix consisting of x,y,z coordinates of several points. I would like to find the extremum points i.e. the two points that are farthest apart.</p>
  
  <p>I could figure out a way in matlab, but i need it in Python</p>
  
  <p>Here is the code in matlab</p>
  
  <pre><code>A = randint(500,3,[-5 5]);
  D=pdist(A);
  D=squareform(D);
  [N,I]=max(D(:));
  [I_row, I_col] = ind2sub(size(D),I);
  </code></pre>
  
  <p>pdist gives the distance between pairs of points(i,j).
  squareform gives the matrix output
  In last two steps I attempt to find the indices of the matrix I_row, I_col..</p>
  
  <p>Points I_row and I_col have the max distance..</p>
  
  <p>Could anybody suggest me an efficient way in python as all my other codes are in Python.</p>