from sklearn.datasets import make_blobs
import pandas as pd
## On importe une fonction qui cocnstruit un dataset à 2 dimension de sklearn
n_samples = 400
random_state = 170
X, y = make_blobs(n_samples=n_samples, random_state=random_state, cluster_std = 0.4)
X = pd.DataFrame(X, columns = ['abscisse','ordonnée'])
from sklearn.cluster import DBSCAN
y_pred = DBSCAN(eps = 0.2, min_samples=5).fit_predict(X)
plt.scatter(X['abscisse'],X['ordonnée'],c= y_pred);