View all values of an array

Asked

Viewed 880 times

4

I wonder how I can see all the values of an array when I print this:

ber_MFSK        = M/2*qfunc(np.sqrt(k*ebno_theory))
print(ber_MFSK)

and give me this:

[  1.58655254e-01   1.30927297e-01   1.04028637e-01 ...,   7.82701129e-04
   1.93985472e-04   3.43026239e-05]

how I can see the other values

  • The problem is in relation to ...? Why don’t you make one for item in ber_MFSK and of the one print(item)?

  • yes that’s the problem , the suggestion solved the problem, thank you

1 answer

4

Numpy Arrays often "summarize" the display of large content and control this by setting up a threshold (limit) which can be set by the method set_printoptions().

For the display of a Numpy Array never be displayed briefly you can do something like:

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

Displays arrays of up to 10 elements without summarizing content:

import numpy as np
np.set_printoptions( threshold=10 )
print(np.arange(10))

Exit:

[0 1 2 3 4 5 6 7 8 9]

Displays arrays of up to 9 elements without summarizing content:

import numpy as np
np.set_printoptions( threshold=9 )
print(np.arange(10))

Exit:

[0 1 2 ..., 7 8 9]

Reference:

https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.set_printoptions.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.