Last active
February 17, 2021 14:18
-
-
Save aialenti/ed0af24821dd08caab9c728b5e06adf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from sklearn.cluster import DBSCAN | |
data = pd.read_csv("data.csv") | |
data["labels"] = DBSCAN(eps=0.01, min_samples=3).fit(data[["lat","lng"]].values).labels_ | |
print(data["labels"].unique()) | |
data.to_csv("out.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment