# 使用SciPy的分位数分位数图

http://en.wikipedia.org/wiki/Quantile-quantile_plot

R和Matlab都为此提供了现成的函数，但是我想知道在Python中实现的最干净的方法是什么。

### 6 Solutions collect form web for “使用SciPy的分位数分位数图”

` `import numpy as np import pylab import scipy.stats as stats measurements = np.random.normal(loc = 20, scale = 5, size=100) stats.probplot(measurements, dist="norm", plot=pylab) pylab.show()` `

` `import numpy as np import statsmodels.api as sm import pylab test = np.random.normal(0,1, 1000) sm.qqplot(test, line='45') pylab.show()` `

` `#!/bin/python import numpy as np measurements = np.random.normal(loc = 20, scale = 5, size=100000) def qq_plot(data, sample_size): qq = np.ones([sample_size, 2]) np.random.shuffle(data) qq[:, 0] = np.sort(data[0:sample_size]) qq[:, 1] = np.sort(np.random.normal(size = sample_size)) return qq print qq_plot(measurements, 1000)` `

` `from bokeh.plotting import figure, show from scipy.stats import probplot # pd_series is the series you want to plot series1 = probplot(pd_series, dist="norm") p1 = figure(title="Normal QQ-Plot", background_fill_color="#E8DDCB") p1.scatter(series1[0][0],series1[0][1], fill_color="red") show(p1)` `
• 在SciPy中创build低通滤波器 - 理解方法和单位
• 重新采样表示图像的numpy数组