title: Sklearn KNN + mahalanobis on python
body: <p>I try to use the function NearestNeighbors on Sklearn. I write an example to understand what's happening on these function.</p>
  
  <pre><code>from sklearn.neighbors import NearestNeighbors
    samples = [[0.2, 0], [0.5, 0.1], [0.4,0.4]]
    neigh = NearestNeighbors(n_neighbors=2,metric='mahalanobis')
    neigh.fit(samples) 
    print(neigh.kneighbors([[272,7522752]])) # use any point to test
  </code></pre>
  
  <p>Above code work well and it can correctly compute the 2 - nearest point .
  But when I try to use my dataset , and some mistakes are happend. Dataset matrix are 9959 * 384 matrix. I print the matrix below , and I declare the matrix training_data</p>
  
  <pre><code>[[ 0.069915  0.020142  0.070054 ...,  0.333937  0.477351  0.055993]
   [ 0.131826  0.038203  0.131573 ...,  0.353589  0.426197  0.048557]
   [ 0.130338  0.02595   0.130351 ...,  0.315951  0.32355   0.098884]
   ..., 
   [ 0.053331  0.023395  0.0534   ...,  0.366064  0.404756  0.066217]
   [ 0.063554  0.021197  0.063671 ...,  0.235945  0.439595  0.105366]
   [ 0.123632  0.045492  0.12322  ...,  0.308702  0.437344  0.040144]]
  </code></pre>
  
  <p>And when I use training_data into above code which just change the samples to training_data, it has a mistake.</p>
  
  <pre><code>LinAlgError: 0-dimensional array given. Array must be at least two- dimensional
  </code></pre>
  
  <p>Please help me solve these questions, tks a lot !</p>