Print numpy array without ellipsis Print numpy array without ellipsis arrays arrays

Print numpy array without ellipsis


use the following snippet to get no ellipsis.

import numpyimport sysnumpy.set_printoptions(threshold=sys.maxsize)

EDIT:

If you have a pandas.DataFrame use the following snippet to print your array:

def print_full(x):    pd.set_option('display.max_rows', len(x))    print(x)    pd.reset_option('display.max_rows')

Or you can use the pandas.DataFrame.to_string() method to get the desired result.

EDIT':

An earlier version of this post suggested the option below

numpy.set_printoptions(threshold='nan')

Technically, this might work, however, the numpy documentation specifies int and None as allowed types. Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.set_printoptions.html.


You can get around the weird Numpy repr/print behavior by changing it to a list:

print list(total_list)

should print out your list of 2-element np arrays.


You are not printing numpy arrays.

Add the following line after the imports:

pd.set_option('display.max_rows', 100000)