Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Of course, you can change the print threshold of the array as <a href="https://stackoverflow.com/q/1987694/1730674">answered elsewhere</a> with:</p> <pre><code>np.set_printoptions(threshold=np.nan) </code></pre> <p>But depending on what you're trying to look at, there's probably a better way to do that. For example, if your array truly is mostly zeros as you've shown, and you want to check whether it has values that are nonzero, you might look at things like:</p> <pre><code>import numpy as np import matplotlib.pyplot as plt In [1]: a = np.zeros((100,100)) In [2]: a Out[2]: array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.]]) </code></pre> <p>Change some values:</p> <pre><code>In [3]: a[4:19,5:20] = 1 </code></pre> <p>And it still looks the same:</p> <pre><code>In [4]: a Out[4]: array([[ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], ..., [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.], [ 0., 0., 0., ..., 0., 0., 0.]]) </code></pre> <p>Check some things that don't require manually looking at all values:</p> <pre><code>In [5]: a.sum() Out[5]: 225.0 In [6]: a.mean() Out[6]: 0.022499999999999999 </code></pre> <p>Or plot it:</p> <pre><code>In [7]: plt.imshow(a) Out[7]: &lt;matplotlib.image.AxesImage at 0x1043d4b50&gt; </code></pre> <p>Or save to a file:</p> <pre><code>In [11]: np.savetxt('file.txt', a) </code></pre> <p><img src="https://i.stack.imgur.com/VtzFS.png" alt="array"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload