Remrinのpython攻略日記

python3に入門しました。python3についてあれこれとサンプルコードとか。

テストデータ

テストデータ(7) 東京の年平均気温

東京の平均気温(気象庁のサイトより) # coding: utf-8 import pandas as pd url = 'http://python-remrin.hatenadiary.jp/entry/2017/05/18/142423' ## DataFrameのリストを得る。header=0のオプション指定で、最初の行をheader扱い。 fetched = pd.io.htm…

テストデータ(6) メフィスト賞

メフィスト賞 import pandas as pd url = 'http://python-remrin.hatenadiary.jp/entry/2017/05/10/222443' ## DataFrameのリストを得る。header=0のオプション指定で、最初の行をheader扱い。 fetched = pd.io.html.read_html(url) print(len(fetched)) # l…

テストデータ(5) 直木賞

直木賞 import pandas as pd url = 'http://python-remrin.hatenadiary.jp/entry/2017/05/10/215715' ## DataFrameのリストを得る。header=0のオプション指定で、最初の行をheader扱い fetched = pd.io.html.read_html(url) print(len(fetched)) # 1 listの…

テストデータ(4) 常用漢字

常用漢字のテストデータです。 data = [""]*7 #小1 data[0] = """ 一右雨円王音下火花貝学気九休玉金空月犬見五口校左三山子四糸字耳七 車手十出女小上森人水正生青夕石赤千川先早草足村大男竹中虫町天田土 二日入年白八百文木本名目立力林六""" #小2 data[1…

テストデータ(3) アミノ酸 コドン表

m-RNAからアミノ酸へのコドン表 bases = "UCAG" codons = [b1+b2+b3 for b1 in bases for b2 in bases for b3 in bases] aminoacids = "FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG" codon_dict = dict(zip(codons, aminoacids)) pri…

テストデータ(1) 百人一首

pythonプログラムの動作テスト用です。 import pandas as pd url = 'http://python-remrin.hatenadiary.jp/entry/2017/04/23/000000' ## DataFrameのリストを得る。header=0のオプション指定で、最初の行をheader扱い。 fetched = pd.io.html.read_html(url)…

テストデータ(2) アンスコムのカルテット

pythonプログラムの動作テスト用です。 ○アンスコムのカルテット x1 y1 x2 y2 x3 y3 x4 y4 10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58 8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76 13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71 9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84 11.…