此專案目的只為了學術技術分享,請勿拿來從事不法行為,違者自行負起法律責任
以Python套件bokeh實作出RFM動態網頁。
- 必須要下載bokeh套件
pip install bokeh
。
- 打開console介面,MAC電腦請開啟Ternimel,範例圖片是windows作業系統,以Anaconda prompt開啟。
- 複製此專案的位置,並且切換至此。
cd 檔案路徑
。
- 輸入
bokeh serve 專案資料夾名稱
開始執行server,若沒有修改資料夾名稱,那指令會是bokeh serve showTable
。
- 在網頁輸入
http://localhost:5006/
,即可進入server網頁。
實作將csv檔案在網頁上以表格的方式呈現,並且依顏色區隔數字大小。
檔案名稱 | 說明 |
---|---|
templates/index.html | 設定html格式,裏頭只有增加css樣式。 |
insurance.csv | 在網頁中呈現的資料。 |
main.py | Python程式碼,bokeh套件的功能都寫在這裡。 |
theme.yaml | bokeh server的環境設定檔案,主要是修改主題相關顏色。 |
將所有的資料,全部都自動以圓餅圖展現出來,並且滑鼠移到上方,能顯示其百分比與真實數量。
檔案名稱 | 說明 |
---|---|
templates/index.html | 設定html格式,裏頭只有增加css樣式。 |
insurance.csv | 在網頁中呈現的資料。 |
main.py | Python程式碼,bokeh套件的功能都寫在這裡。 |
theme.yaml | bokeh server的環境設定檔案,主要是修改主題相關顏色。 |
利用網頁動畫,讓品牌的GPS市場定位圖活起來,馬上讓您知道公司位於市場的何處,與競爭對手的距離一目瞭然。
檔案名稱 | 說明 |
---|---|
templates/index.html | 設定html格式,裏頭只有增加css樣式。 |
data.py | 創造資料。 |
main.py | Python程式碼,bokeh套件的功能都寫在這裡。 |
theme.yaml | bokeh server的環境設定檔案,主要是修改主題相關顏色。 |
以保險業為例,製作類別型資料的RFM Model。
檔案名稱 | 說明 |
---|---|
templates/index.html | 設定html格式,裏頭只有增加css樣式。 |
cut_dataframe.py | 切割RFM資料。 |
insurance.csv | 在網頁中呈現的資料。 |
main.py | Python程式碼,bokeh套件的功能都寫在這裡。 |
theme.yaml | bokeh server的環境設定檔案,主要是修改主題相關顏色。 |
以保險業為例,製作數值型資料的RFM Model。
檔案名稱 | 說明 |
---|---|
templates/index.html | 設定html格式,裏頭只有增加css樣式。 |
cut_dataframe.py | 切割RFM資料。 |
insurance.csv | 在網頁中呈現的資料。 |
main.py | Python程式碼,bokeh套件的功能都寫在這裡。 |
theme.yaml | bokeh server的環境設定檔案,主要是修改主題相關顏色。 |