参考链接https://ask.csdn.net/questions/365756
今天一直在找关于幂律分布的验证相关资料,很多都是只言片语,这个图首先解释了幂律分布的定义
2.然后,https://www.douban.com/group/topic/69712255/ 真正实践去验证的时候,先在python环境下安装powerlaw包,然后这个链接内容告诉我们具体怎么应用这个包,对每行代码的解释真心很详细!powerlaw.Fit拟合幂律分布
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib.pylab import plt
import powerlaw
#打开数据包------------------------------------------------------------
data=np.loadtxt('C:/Users/peterduus/degree.txt')
#用numpy的loadtxt()方法把文本数据读入二维数组---------------------------
fit=powerlaw.Fit(data,discrete=True)
print 'xmin\t=',fit.xmin
print 'alpha\t=',fit.power_law.alpha
print &