data = ['ACCTCCTAGAAG', 'ACCTACTAGAAGTT', 'GAATATTAGGCCGA']

def lev_metric(x, y):
    i, j = int(x[0]), int(y[0])
return levenshtein(data[i], data[j])
X = np.arange(len(data)).reshape(-1, 1)
Python: String clustering with scikit-learn's dbscan, using Levenshtein distance as metric: