File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import pandas as pd
import numpy as np
# from main import show
df = pd.read_csv("영천시_상권형성.csv")
cluster_counts = df.loc[:,'CLUSTER_ID'].value_counts()
cluster_counts = pd.DataFrame(cluster_counts)
# print(cluster_counts)
cluster_choice = cluster_counts.iloc[:3].index.values
cluster_choice = np.append(cluster_choice, 3)
out_csv = pd.DataFrame()
for choice in cluster_choice:
dfc = df.query(f"(CLUSTER_ID == {choice})")
sector_info = dfc.loc[:,'상권업종_2'].value_counts()
out_csv = pd.concat((out_csv, sector_info), axis=1,)
print(sector_info)
out_csv.columns = ['cluster1', 'cluster2', 'cluster3', '서부동']
out_csv.to_csv("dbscan클러스터링_상권업종정보_중분류.csv")