11

As shown in the screenshot a 2D numpy array is truncated for printing purposes. I would like to have all elements displayed. Is there an option setting to enable that behavior?

enter image description here

WestCoastProjects
  • 53,260
  • 78
  • 277
  • 491

1 Answers1

13

See the docs on print options. Specifically:

threshold : int, optional

Total number of array elements which trigger summarization rather than full repr (default 1000).

So setting threshold to np.inf means it is never summarized.

np.set_printoptions(threshold=np.inf)
Community
  • 1
  • 1
Alex
  • 17,062
  • 7
  • 54
  • 78