Simple Guide to Print Full Numpy Array Without Truncation – NumPy Tutorial

By | August 9, 2021

In this tutorial, we will introduce how to print a full numpy array without truncation. You can learn how to do by following our steps.

Look at example code below:

import numpy as np

data = np.random.random([50, 50])
print(data)

Run this code, you will see this result:

Print Numpy Array With Truncation - NumPy Tutorial

You will find we can not see full numpy array.

How to print full numpy array?

We can use np.set_printoptions(threshold=np.inf) to implement it.

Look at this example:

import numpy as np
np.set_printoptions(threshold=np.inf)

data = np.random.random([50, 50])
print(data)

Run this code, you will see this full numpy array as follows:

Simple Guide to Print Full Numpy Array Without Truncation - NumPy Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *