当前位置:主页 > 软件编程 > Python代码 >

python 解决print数组/矩阵无法完整输出的问题

时间:2021-03-11 10:08:15 | 栏目:Python代码 | 点击:

当数组/矩阵过大则只会显示其中一部分,中间则会自动用省略号代替:

直接在import numpy 加上下面一句代码即可解决:

import numpy as np
 
np.set_printoptions(threshold=np.inf)

这样就可以将比较大的数组全显示出来:

您可能感兴趣的文章:

相关文章