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 urllib2 | |
import re | |
import time | |
import json | |
import os | |
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
#!/usr/bin/env python | |
#coding:UTF-8 | |
# 馬偕 by t0mst0ne | |
import os | |
import re | |
import json | |
import requests | |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# 嘉義基督教醫院 | |
import requests | |
import re | |
import time | |
import json | |
import os | |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pandas as pd | |
data = pd.read_json('npolist.json',orient="columns") | |
type(data) | |
data |
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 | |
HUA = pd.io.parsers.read_csv('https://raw.githubusercontent.com/g0v/cec/master/2014/booth/HUA.csv') | |
pre = pd.io.parsers.read_csv('https://raw.githubusercontent.com/g0v/cec/master/13th.csv',sep='\t') | |
pre['together'] = pre['縣市碼']+pre['投票所名稱'] | |
mydict = pre.set_index('together')['地址'].to_dict() | |
HUA['Address2'] = '花蓮縣' + HUA['投開票所設置處所'] |
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 | |
for i in range (1, 21): | |
data = pd.read_csv('../' + str(i) + '.csv') | |
delta = data["Total"] - data["First"] - data["Second"] - data["Third"] | |
data['delta'] = delta | |
data['one'] = 1 | |
Age = data.ix[data20['County']=='TPE'] | |
Age = pd.tools.pivot.pivot_table(Age, values='one', index=['delta'], columns=['Age'],aggfunc=np.sum, margins = False) | |
print Age.T.plot() | |
Age.T.plot().savefig('/path/to/figure.pdf') |
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
#coding:UTF-8 | |
import xml.etree.cElementTree as ET | |
import pandas as pd | |
from pygeocoder import Geocoder | |
import urllib | |
import time | |
feed = urllib.urlopen("http://data.fda.gov.tw/cacheData/35_1.xml;jsessionid=C8F4570A382FF8BFC9CC901CD802F0EF") | |
tree = ET.parse(feed) |
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 requests | |
import re | |
import json | |
import pandas as pd | |
import datetime | |
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
#!/usr/bin/env python | |
#coding:UTF-8 | |
import requests | |
from scrapy.selector import Selector | |
r = requests.get('http://www.icd10data.com/ICD10CM/Codes/C00-D49/C00-C14/C03-/C03.1') | |
Selector(text=r.text).xpath('//a[contains(@href, "/ICD10CM/DRG/")]/@href').extract() |
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 | |
# revised on 2014.10.31 due to website change | |
import requests, json, os, re | |
from datetime import datetime | |
os.environ['TZ'] = 'ROC' | |
html = requests.get('http://hlm.tzuchi.com.tw/html/hlinfos.html') | |
query = re.findall(u'<em>(.*?)</em>', html.text) | |
full_reported = False if u'N' in query[0] else True |
OlderNewer