0

I'm converting a list into a NumPy array:

a = np.array(l) # Where l is the list of data 
return a

But whenever I go to print this array:

print (a)

I only get a slice of the array:

[-0.00750732 -0.00741577 -0.00778198 ..., 0.00222778 0.00219727 -0.00048828]

However, If I print the size, I get the actual size of the array: 61238 Could anyone have a guess to where I am going wrong?

Phorce
  • 4,424
  • 13
  • 57
  • 107

2 Answers2

3

You can change the summarization options with set_printoptions

np.set_printoptions(threshold = your_threshold)

The threshold parameter sets:

Total number of array elements which trigger summarization rather than full repr (default 1000).

But do you really want to print a huge array?

YXD
  • 31,741
  • 15
  • 75
  • 115
2

It's just for the reason of usability. If you have an array of size 10^100 and you try to print it - that would take a long-long time. So, that's why it's printed like this, like "that is that exact array that is starts from X and ends with Y". To print the whole array just print every element in a for-loop :)

Ben Usman
  • 7,969
  • 6
  • 46
  • 66