15

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

1
  • numpy.set_printoptions(threshold=numpy.nan) maybe you can try it Commented Feb 4, 2018 at 1:45

1 Answer 1

18

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)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.