import numpy as np for k,v in stat.iteritems(): print k v.sort() #v = v[len(v)*3/100:len(v)*97/100] data = np.array(v) hist,bins=np.histogram(data,bins=np.linspace(data.min(),data.max(),20)) #hist,bins=np.histogram(data,bins=2…
Numpy学习之--数组创建 过程展示 import numpy as np a = np.array([2,3,9]) a array([2, 3, 9]) a.dtype dtype('int32') b = np.array([1.2,2.3,3]) b array([1.2, 2.3, 3. ]) b.dtype dtype('float64') 常见的错误是:直接将多个数值当做参数传递,正确的做法是将他们以列表或数组的方式传递 # a = np.array(1,2,3)#错误 b =…