# -*- coding: utf-8 -*-
"""
Created on Sat Oct 14 17:03:39 2017
@author: wnma3
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
"""
代碼說明:
programmer_1: 制作箱線圖
data.boxplot-->數據轉為箱線圖的字典格式
plt.annotate-->繪圖
programmer_2: 計算數據
range-->極差
var-->方差
dis-->四分距
programmer_3: 畫出盈利圖(比例和數值)
programmer_4: 計算成對相關性
data.corr()-->dataframe中相互之間的相關性
data.corr()[u'百合醬蒸鳳爪'] -->dataframe某一項與其他項的相關性
"""
def programmer_1(file_name):
catering_sale = file_name
data = pd.read_excel(catering_sale, index_col=u'日期')
plt.figure()
# 畫箱線圖
p = data.boxplot(return_type='dict')
x = p['fliers'][0].get_xdata()
y = p['fliers'][0].get_ydata()
y = np.sort(y)
for i in range(len(x)):
# 處理臨界情況, i=0時
temp = y[i] -