我对这个问题不太熟悉。我想听听你的建议。抱歉,如果是业余的。你知道吗
我有下面的代码,它最终显示了一个情节。我只写了一部分代码。你知道吗
...
cov = np.dot(A, A.T)
samps2 = np.random.multivariate_normal([0]*ndim, cov, size=nsamp)
print(samps2)
names = ["x%s"%i for i in range(ndim)]
labels = ["x_%s"%i for i in range(ndim)]
samples2 = MCSamples(samples=samps2,names = names, labels = labels, label='Second set')
g = plots.getSubplotPlotter()
g.triangle_plot([samples2], filled=True)
没问题。绘图是使用来自samps2
的数据绘制的。为了了解samps2
是什么,我们做print(samps2)
,然后看:
[[-0.11213986 -0.0582685 ]
[ 0.20346731 0.25309022]
[ 0.22737737 0.2250694 ]
[-0.09544588 -0.12754274]
[-1.05491483 -1.15432073]
[-0.31340717 -0.36144749]
[-0.99158936 -1.12785124]
[-0.5218308 -0.59193326]
[ 0.76552123 0.82138362]
[ 0.65083618 0.70784292]]
我的问题是,如果我想从txt
文件中读取这些数据。我该怎么办?你知道吗
谢谢你。你知道吗
有几种方法。我想到的是:
普通Python:
努比:
熊猫:
相关问题 更多 >
编程相关推荐