Mean shift finds clusters without being told how many there are: every point climbs uphill on the estimated density until it reaches a peak (a mode), and points that reach the same mode form a cluster.
Implement mean_shift(X, bandwidth, tol=1e-5, max_iter=300):
tol (or max_iter is reached).bandwidth / 2; otherwise it becomes a new centre.(centres, labels), with centres as an array in order of creation.