How to print the full NumPy array without truncation

You can print the full NumPy array without truncation with the following code. If you want to learn Python, I highly recommend reading This Book.

How to print the full NumPy array without truncation

Example

import numpy as np
import sys

#This option will print whole NumPy array without truncation.
np.set_printoptions(threshold=sys.maxsize)

x = np.arange(10000)
print(x)

Output:

In this example, the whole NumPy array will be printed without truncation. Numbers from 0 to 9999.

People are also reading:

Best Python Books

What is Computer Vision? Examples, Applications, Techniques

Books for Machine Learning (ML)

Free Learning Resources

Leave a Comment

Your email address will not be published.