当我打印一个numpy数组时,我得到了一个截断的表示形式,但是我想要完整的数组。
有什么办法吗?
例子:
>>> numpy.arange(10000) array([ 0, 1, 2, ..., 9997, 9998, 9999]) >>> numpy.arange(10000).reshape(250,40) array([[ 0, 1, 2, ..., 37, 38, 39], [ 40, 41, 42, ..., 77, 78, 79], [ 80, 81, 82, ..., 117, 118, 119], ..., [9880, 9881, 9882, ..., 9917, 9918, 9919], [9920, 9921, 9922, ..., 9957, 9958, 9959], [9960, 9961, 9962, ..., 9997, 9998, 9999]])
用途numpy.set_printoptions:
numpy.set_printoptions:
import sys import numpy numpy.set_printoptions(threshold=sys.maxsize)