【发布时间】:2015-06-06 03:17:01
【问题描述】:
我有一个 236 x 97 维度的矩阵。当我在 Python 中打印矩阵时,它的输出不完整,矩阵中间有 .......。
我尝试将矩阵写入测试文件,但结果完全相同。 我无法发布屏幕截图,因为我的声誉不够,如果我选择其他标记选项,将无法正确显示。 谁能解决这个问题?
def build(self):
self.keys = [k for k in self.wdict.keys() if len(self.wdict[k]) > 1]
self.keys.sort()
self.A = zeros([len(self.keys), self.dcount])
for i, k in enumerate(self.keys):
for d in self.wdict[k]:
self.A[i,d] += 1
def printA(self):
outprint = open('outputprint.txt','w')
print 'Here is the weighted matrix'
print self.A
outprint.write('%s' % self.A)
outprint.close()
print self.A.shape
【问题讨论】:
标签: python python-2.7 matrix python-2.x