现在已经一岁了,但也许这个答案能帮助别人。
numpy数组的显示方式取决于很多事情。
使用此代码,您可以显示更多项目并使用屏幕的整个宽度:
这是默认值import numpy as np
np.set_printoptions(edgeitems=3)
np.core.arrayprint._line_width = 80
>>> array([[[0, 0, 0, ..., 0, 0, 0],
>>> [0, 0, 0, ..., 0, 0, 0],
>>> [0, 0, 0, ..., 0, 0, 0],
>>> ...,
使用以下代码可以增加每个数组边缘(开始和结束)显示的项以及线宽:import numpy as np
np.set_printoptions(edgeitems=10)
np.core.arrayprint._line_width = 180
>>> array([[[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
>>> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
>>> [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],