嗨我需要绘制矩阵的内容,其中每行代表不同的特征,每列是不同的时间点.换句话说,我希望随着时间的推移看到功能的变化,并且我已经以矩阵的形式堆叠了每个特征.C是矩阵
A=C.tolist() #convert matrix to list.
R=[]
for i in xrange(len(A[0])):
R+=[[i]*len(A[i])]
for j in xrange(len(A[0])):
S=[]
S=C[0:len(C)][j]
pylab.plot(R[j],S,'r*')
pylab.show()
Run Code Online (Sandbox Code Playgroud)
这是对的/有更有效的方法吗?谢谢!
我有一个图像序列,我试图在特定的帧上运行脚本.我需要切换到这个框架并将其转换为数组.但是,我无法将框架作为实例<TiffImagePlugin.TiffImageFile image mode=I;16 size=512x512 at 0x104A0C998>.如何将此实例转换为数组?我已经使用过numpy.array但它不起作用.谢谢!
prot=Image.open("F23BN.tif")
for frame in ImageSequence.Iterator(dna):
if frame==16:
frame.convert('L')
print frame.mode, frame.format #I checked the format and it is still in the Instance format
Run Code Online (Sandbox Code Playgroud)