Chapter 7: Miscellaneous

Printing more values

face Josiah Wang

When an array is too large, NumPy only prints values at the start and end of the array.

>>> print(np.arange(2000))
[0 1 2 ... 1997 1998 1999]

If you want to see more values printed, set this using set_printoptions().

>>> np.set_printoptions(threshold=10000) # default threshold is 1000
>>> print(np.arange(2000))  
# should print all numbers now... not going to show this here!