This file contains hidden or 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 | |
import json | |
import requests | |
url = 'http://portal-api.g0v.ronny.tw/api/searchgoodidcountry/in/1201/%E5%B7%B4%E8%A5%BF' | |
url2 = 'http://portal-api.g0v.ronny.tw/api/searchgoodidcountry/in/1201/%E7%BE%8E%E5%9C%8B' | |
src = json.loads(requests.get(url).text) | |
src2 = json.loads(requests.get(url2).text) |
This file contains hidden or 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
#!/usr/bin/env ptyhon | |
#coding:UTF-8 | |
import requests, json, os, re | |
from datetime import datetime | |
os.environ['TZ'] = 'ROC' | |
html = requests.get('http://www.scmh.org.tw/FirstAid.aspx?Kind=2') | |
reported = re.findall(u'(.*119.*)',html.text) | |
full_reported = False if u'未' in reported[1] else True |
This file contains hidden or 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
#!/usr/bin/env ptyhon | |
#coding:UTF-8 | |
import xml.etree.cElementTree as ET | |
import requests | |
import pandas as pd | |
import datetime, os | |
# Official explaination of dataset :http://data.gov.tw/node/7504 | |
os.environ['TZ'] = 'ROC' |
This file contains hidden or 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
楊文值 平和國小割草機設備工程 壽豐鄉 (102.04.2核銷) 40 40 鄉鎮公共工程 壽豐鄉公所 無;首長本權責 吉利農業資材行 | |
楊文值 民權里里辦公處設備工程 花蓮市 (102.04.02核銷) 98 98 鄉鎮公共工程 花蓮市公所 無;首長本權責 億學實業有限公司 | |
楊文值 中華國小校內設備(行政會議辦公桌)工程 花蓮市 (102.04.17核銷) 97 97 鄉鎮公共工程 花蓮市中華國小 無;首長本權責 東源辦公家具行 | |
楊文值 民權里里辦公處內部設備工程 花蓮市 (102.04.25核銷) 98 98 鄉鎮公共工程 花蓮市公所 共同供應契約〈台銀採購部〉無;首長本權責 1.向達企業股份有限公司2.億學實業有限公司 | |
楊文值 國威里里辦公處內部設備工程 花蓮市 (102.04.29核銷) 49 49 鄉鎮公共工程 花蓮市公所 共同供應契約〈台銀採購部〉 億學實業有限公司 | |
楊文值 瑞穗鄉內路燈工程 瑞穗鄉 (102.05.07核銷) 95 95 鄉鎮公共工程 瑞穗鄉公所 無;首長本權責 順泰水電行 | |
楊文值 民主里中山路16巷排水溝改善工程(併蔡啟塔NO.6,結算金額共408,406元) 花蓮市 (102.05.23核銷) 135 127 鄉鎮公共工程 花蓮市公所 開口契約 中華土木包工業 | |
楊文值 花崗國中校內設備(電腦及急救換藥推車)工程 花蓮市 (102.06.14核銷) 35 30 鄉鎮公共工程 花蓮市花崗國中 共同供應契約〈台銀採購部〉無;首長本權責 1.旭強資訊有限公司2.富誠生物科技有限公司 | |
楊文值 中正國小電話交換機設備工程 花蓮市 (102.07.30核銷) 99 99 鄉鎮公共工程 花蓮市中正國小 無;首長本權責 昶通通信有限公司 | |
楊文值 民德里里內排水溝改善工程(併莊枝財NO.31、NO.37等3案,結算金額共474,612元整) 花蓮市 (102.07.31核銷) 95 93 鄉鎮公共工程 花蓮市公所 開口契約 中華土木包工業 |
This file contains hidden or 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
楊文值 國威里里辦公處內部設備(廣播音響及手提擴音器)工程 花蓮市 (103.3.14核銷) 69 69 鄉鎮公共工程 花蓮市公所 無;首長本權責 億學實業有限公司 | |
楊文值 中正國小樂器設備工程 花蓮市 (103.3.18核銷) 750 750 鄉鎮公共工程 中正國小 公開招標 六度企業社 | |
楊文值 花崗國中視聽教室及管樂室冷氣設備工程 花蓮市 (103.4.16核銷) 1,066 1,060 鄉鎮公共工程 花崗國中 共同供應契約〈台銀採購部〉 葉氏企業 | |
楊文值 瑞祥村農水路中段路燈工程 瑞穗鄉 (103.4.21核銷) 96 96 鄉鎮公共工程 瑞穗鄉公所 無;首長本權責 順泰水電行 | |
楊文值 民權里里辦公處內部設備工程 花蓮市 (103.5.7核銷) 95 95 鄉鎮公共工程 花蓮市公所 1.共同供應契約〈台銀採購部〉2.共同供應契約〈台銀採購部〉3.無;首長本權責 億學實業有限公司 | |
楊文值 光復鄉內道路水泥路面設施工程 光復鄉 (103.5.27核銷) 98 98 鄉鎮公共工程 光復鄉公所 無;首長本權責 和昇工程行 | |
楊文值 民有里北濱街69巷圍牆彩繪工程 花蓮市 (103.6.24核銷) 99 93 鄉鎮公共工程 花蓮市公所 無;首長本權責 乙太國際實業有限公司 | |
楊文值 花蓮縣消防局玉里消防分隊通訊設備工程 花蓮縣 (103.6.24核銷) 98 98 鄉鎮公共工程 光復鄉公所 無;首長本權責 祐佳企業社 | |
楊文值 花蓮縣警察局花蓮分局設施改善工程 花蓮縣 (103.6.27核銷) 98 98 鄉鎮公共工程 花蓮縣警察局 無;首長本權責 竣豐企業社 | |
賴進坤 新城鄉內路燈改善工程 新城鄉 (103.6.04核銷) 150 142 鄉鎮公共工程 新城鄉公所 開口契約 德興電器水電工程行 |
This file contains hidden or 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
#!/usr/bin/env python | |
#coding:UTF-8 | |
import re | |
import json | |
import requests | |
import datetime | |
import pandas as pd | |
headers = { | |
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", |
This file contains hidden or 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
#!/bin/sh | |
# installation of Oracle Java JDK. | |
sudo apt-get -y update | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get -y update | |
sudo apt-get -y install oracle-java7-installer | |
# Installation of commonly used python scipy tools |
This file contains hidden or 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
#from influxdb import InfluxDBClient | |
from influxdb.influxdb08 import InfluxDBClient | |
import fileinput | |
import json | |
import ast | |
client = InfluxDBClient('IP', 8086, 'ID', 'pw', 'twer') | |
for line in fileinput.input(): | |
line = line.replace('false','False').replace('true','True').replace('update_time','time').rstrip('\n') |
This file contains hidden or 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
#!/usr/bin/env python | |
#coding:UTF-8 | |
import pandas as pd | |
import scrapy | |
import requests | |
from scrapy.selector import Selector | |
from datetime import date | |
# pull observer lists | |
all_data = 'http://www.cwb.gov.tw/V7/observe/real/ALL.htm' |
This file contains hidden or 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
def plot_correlogram(df,figsize=(20,20)): | |
''' Creat an n x n matrix of scatter plots for every | |
combination of numeric columns in a dataframe''' | |
cols = list(df.columns[df.dtypes=='float64']) | |
n = len(cols) | |
fig, ax = plt.subplots(n,n,figsize=figsize) | |
for i,y in enumerate(cols): | |
for j,x in enumerate(cols): | |
if i != n-1: |