title: How to use DBSCAN algorithm for a list of points in python
body: <p>I am new to image processing and python coding.
  I have detected a number of features in an image and have their respective pixel locations placed in a list format.</p>
  
  <pre><code>My_list = [(x1,y1),(x2,y2),......,(xn,yn)]
  </code></pre>
  
  <p>I would like to use DBSCAN algorithm to form clusters from the following points.
  Currently using sklearn.cluster to import the build in DBSCAN function for python.
  If the current format for the points is not compatible would like to know which is?</p>
  
  <p>Error currently facing with the current format:  </p>
  
  <pre><code>C:\Python\python.exe "F:/opencv_files/dbscan.py"  
  **Traceback (most recent call last):**
    **File "**F:/opencv_files/dbscan.py**", line 83, in &lt;module&gt;  
      db = DBSCAN(eps=0.5, min_samples=5).fit(X) # metric=X)**  
    **File "**C:\Python\lib\site-packages\sklearn\cluster\dbscan_.py**", line 282, in fit  
      X = check_array(X, accept_sparse='csr')  
    File "**C:\Python\lib\site-packages\sklearn\utils\validation.py**", line 441, in check_array  
      "if it contains a single sample.".format(array))  
  ValueError: Expected 2D array, got 1D array instead:  
  array=[].  
  Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.**
  </code></pre>