#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 9 14:26:54 2017
@author: lu
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.cluster.hierarchy import dendrogram, linkage
from sklearn.cluster import AgglomerativeClustering
"""
programmer_1-->獲取數據,進行離差標准化
programmer_2-->畫譜系聚類圖
programmer_3-->層次聚類算法,並且將每類進行可視化操作
"""
def programmer_1():
filename = "data/business_circle.xls"
standardizedfile = "tmp/standardized.xls"
data = pd.read_excel(filename, index_col=u"基站編號")
data = (data - data.min()) / (data.max() - data.min())
data = data.reset_index()
data.to_excel(standardizedfile, index=False)
def programmer_2():
standardizedfile = "data/standardized.xls"
data = pd.read_excel(standardizedfile, index_col=u"基站編號"