| 正規表現をたしかめる: | M-x re-builder |
|---|---|
| 正規表現をコピーする: | C-c C-w |
| re-builderの終了: | C-c C-q |
| 正規表現を用いて置換: | M-s M-% (foreign-regexp/query-replace) |
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 sys, math | |
| from collections import defaultdict | |
| import requests | |
| from lxml import etree | |
| APP_ID = '*****' | |
| API_URL = "http://jlp.yahooapis.jp/MAService/V1/parse"; | |
| DEFAULT_FILTER = (1,2,3,4,5,9,10) |
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 csv | |
| import math | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from collections import defaultdict | |
| DATA = [ | |
| (400, 60), | |
| (15, 30), | |
| (480, 365), |
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 csv | |
| import math | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from collections import defaultdict | |
| DATA = [ | |
| (400, 60), | |
| (15, 30), | |
| (480, 365), |
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 numpy as np | |
| from scipy.stats import gmean | |
| d1 = [2,4,5,7] | |
| d2 = [2,4,5,70] | |
| print np.average(d1), np.average(d2) | |
| print gmean(d1), gmean(d2) |
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 matplotlib.pyplot as plt | |
| import numpy as np | |
| l = 5 | |
| sample = 10000 | |
| data = np.random.poisson(l, sample) | |
| n, bins, patches = plt.hist(data, bins=14, normed=True) | |
| plt.show() |
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 scipy.stats | |
| import numpy as np | |
| import scipy as sp | |
| DATA = [ | |
| (400, 60), | |
| (15, 30), | |
| (480, 365), | |
| (993, 190), | |
| (600, 136), |
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 scipy.stats | |
| import scipy as sp | |
| data = [3, 4, 5, 2, 3, 4, 5, 6, 4, 7] | |
| print sp.stats.skew(data) # 0.303193339354 | |
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 scipy.stats | |
| import numpy as np | |
| import scipy as sp | |
| DATA = [ | |
| (400, 60), | |
| (15, 30), | |
| (480, 365), | |
| (993, 190), | |
| (600, 136), |
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 matplotlib.mlab as mlab | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| sample = 10000 | |
| mu, std = 0, 10 | |
| data = [np.mean(np.random.normal(mu, std, sample)) for x in range(sample)] | |
| n, bins, patches = plt.hist(data, bins=50, normed=True) |