import matplotlib.pyplot as plt
from sklearn.cluster import DBSCAN
from pandas import DataFrame

Data = {
	'x': [35,34,32,37,33,33,31,27,35,34,62,54,57,47,50,57,59,52,61,47,50,48,39,40,45,47,39,44,50,48],
        'y': [79,54,52,77,59,74,73,57,69,75,51,32,40,47,53,36,35,58,59,50,23,22,13,14,22,7,29,25,9,8]
       }
  
df = DataFrame(Data,columns=['x','y'])

clustering = DBSCAN(eps=5, min_samples=3).fit(df)
labels = clustering.labels_
numberofclusters = len(set(labels)) - (1 if -1 in labels else 0)
plt.title('DBSCAN Number of clusters: %d' % numberofclusters)
plt.scatter(df['x'], df['y'], c=clustering.labels_.astype(float))
plt.show()
