用于大数据的python lattice binning包
latbin的Python项目详细描述
这个python包用于将多个 尺寸。
为什么使用格
对于“常规”的二维历史编程,您隐式地使用z2格!但是 z2格的量子化误差大于a2。
在此处插入图表,显示Z2和A2的正确比较,给出 创建Z2-A2比较的文件
基本示例
这个例子展示了如何获取一个普通的数据集并用直方图表示数据 在A2(又名蜂巢)格子上使用latbin。
importlatbinimportnumpyasnp# create some fake data with shape (npts,ndim)npts,ndim=60000,2data=np.random.normal(size=(npts,ndim))*4.0# create an A2 lattice (honeycomb binning)a2=latbin.ALattice(2)# histogram the data onto A2 Latticeh=a2.histogram(data)# get the lattice points in the data spacecenters=h.centers()# show the resultimportmatplotlib.pylabaspltplt.title("Honeycomb binning (A2 Lattice)")plt.scatter(centers[:,0],centers[:,1],c=h.values(),s=70)plt.show()
安装
在终端中,您可以用通常的方式安装它。
python setup.py install