1

Quick question, I used sublime to code python, when I print output of a list (a very long list), the console automatically omit some values in the middle of list with dot.

['yes' 'yes' 'yes' ..., 'no' 'no' 'no']

How can I see all the values in the list?

HAO CHEN
  • 1,059
  • 3
  • 16
  • 32
  • I read values from a csv file and saved as an array, I want to print this array, because this array is very long, 2000 values in this array, so the console omit values, how can I print the all values? I just use code 'print array' – HAO CHEN Jan 05 '17 at 11:08
  • weird i try print 40k len charater in list, never omit output – Tyler Jan 05 '17 at 11:14
  • is it because I used numpy array to save data instead of using list? – HAO CHEN Jan 05 '17 at 11:15

1 Answers1

1

Do this before running your print(array) if you are on Python 3:

import sys
import numpy

numpy.set_printoptions(threshold=sys.maxsize)

Or this if you are on Python 2:

import sys
import numpy

numpy.set_printoptions(threshold=sys.maxint)
MattDMo
  • 96,286
  • 20
  • 232
  • 224
user
  • 7,316
  • 9
  • 70
  • 122