Numpy直方图输出到文件

时间:2014-10-01 07:11:33

标签: python numpy

我是python和numpy的初学者。

以下是我正在处理的脚本部分。我能够将最终值输出到hist.txt,但我希望输出为3D数组,其中第一列是binX,第二列是bin Y,第三列是hist2。

HISTOGRAM EVERYTHING

hist2, newedgesX, newedgesY = np.histogram2d(inputfile[:,0], inputfile[:,1], bins = (binsX, binsY), weights=weights )
cb_max=8  ## MAX VALUE TO SET ALL INFINITY VALUES TOO AND TO SET THE COLORBAR TO
hist2=prephist(hist2, cb_max)
np.savetxt('hist.txt',hist2,delimiter='\n')
cbar_ticks=[0, cb_max*.25, cb_max*.5, cb_max*.75, cb_max]

0 个答案:

没有答案