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?

0

2 Answers 2

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?

Sign up to request clarification or add additional context in comments.

Comments

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 :)

1 Comment

Well you just made me look stupid..;) Thank you for your help :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.