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
  • 58,982
  • 91
  • 316
  • 560

1 Answers1

12

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
  • 18,484
  • 8
  • 60
  • 80