[IPython-user] NumPy display problem

Ryan Krauss ryanlists at gmail.com
Wed Jan 25 08:35:50 CST 2006


I am not really using NumPy, but oddly enough there is a message that
prints that the array is a NumPy array.  I had switched to the new
scipy and then switched back because of weave problems.

My matplotlibrc numerix switch is set to numarray.  If I create a
rand(21000), I get this message at the top of the printout:

In [6]: a[0:1000]
Out[6]: NumPy array, format: long

and

In [5]: type(a)
Out[5]: <type 'array (scipy)'>

If the new numpy takes care of this, I will try switching back shortly.

Thanks,

Ryan

On 1/25/06, Travis E. Oliphant <oliphant.travis at ieee.org> wrote:
> Ryan Krauss wrote:
> > I just accidentally requested a 21000 element NumPy array be printed
> > to the ipython terminal (by just typing the variable name at the
> > interactive prompt).  It seems like this used to be handled gracefully
> > by printing the first 100 or so elements and then a mesage about there
> > being more elments.  But this isn't happening for me, instead it hangs
> > for a few seconds and then prints the entire array.
> >
> > Am I doing something wrong?
>
> What are you running?  Are you really using NumPy or are you using Numeric?
>
> In [1]: a = rand(21000)
>
> In [2]: a
> Out[2]:
> array([ 0.72911787,  0.41493949,  0.88521075, ...,  0.3816934 ,
>          0.71684723,  0.18389534])
>
>
> NumPy has a limit in the number of elements that are printed.  The
> default is 1000 I think.  It can be changed using set_printoptions.
>
> The code is adapted from NumArray so thank Perry Greenfield and friends
> for this very nice feature :-)
>
> -Travis
>
> _______________________________________________
> IPython-user mailing list
> IPython-user at scipy.net
> http://scipy.net/mailman/listinfo/ipython-user
>




More information about the IPython-user mailing list