[Numpy-discussion] repr for numarray

Paul F Dubois paul at pfdubois.com
Tue Jun 11 13:55:01 EDT 2002


MA users seem to all be happy with the facility in MA for limiting
printing.
>>> x=MA.arange(20)
>>> x
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,])
>>> MA.set_print_limit(10)
>>> x
array([0,1,2,3,4,5,6,7,8,9,]
 + 10 more elements)
>>> print x
[0,1,2,3,4,5,6,7,8,9,]
 + 10 more elements
>>> MA.set_print_limit(0) # no limit
>>> x
array([ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19])
> -----Original Message-----
> From: numpy-discussion-admin at lists.sourceforge.net 
> [mailto:numpy-discussion-admin at lists.sourceforge.net] On 
> Behalf Of Tim Hochberg
> Sent: Tuesday, June 11, 2002 12:29 PM
> To: numpy-discussion at lists.sourceforge.net
> Subject: Re: [Numpy-discussion] repr for numarray
> 
> 
> 
> I would also be inclined toward option 3 with the caveat that 
> THRESHOLD=None should print all the values for the purists 
> out there (or if you want to use repr to dump the array to 
> some sort of flat file).
> 
> -tim
> 
> 
> > On June 11, 2002 02:43 pm, Perry Greenfield wrote:
> >
> > > Yet on the other hand, it is undeniably convenient to use 
> repr (by 
> > > typing a variable) for small arrays interactively rather 
> than using 
> > > a print statement. This leads to 3 possible proposals for 
> handling 
> > > repr:
> > >
> > > 1) Do what is done now, always print a string that when 
> eval'ed will 
> > > recreate the array.
> > >
> > > 2) Only give summary information for the array regardless of its 
> > > size.
> > >
> > > 3) Print the array if it has fewer than THRESHOLD number of 
> > > elements, otherwise print a summary. THRESHOLD may be adjusted by 
> > > the user.
> > >
> > > The last appears to be the most utilitarian to us, yet 'impure' 
> > > somehow.  Certainly there are may objects for which
> >
> > I vote for number 3, and have no hang-ups about any real or 
> perceived 
> > "impurity".  This is an issue that I deal with daily.
> >
> > Scott
> >
> >
> > --
> > Scott M. Ransom              Address:  McGill Univ. Physics Dept.
> > Phone:  (514) 398-6492                 3600 University St., Rm 338
> > email:  ransom at physics.mcgill.ca       Montreal, QC  Canada H3A 2T8
> > GPG Fingerprint: 06A9 9553 78BE 16DB 407B  FFCA 9BFA B6FF FFD3 2989
> >
> > _______________________________________________________________
> >
> > Multimillion Dollar Computer Inventory
> > Live Webcast Auctions Thru Aug. 2002 -
> http://www.cowanalexander.com/calendar
> >
> >
> >
> > _______________________________________________
> > Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> >
> 
> 
> _______________________________________________________________
> 
> Multimillion Dollar Computer Inventory
> Live Webcast Auctions Thru Aug. 2002 - 
> http://www.cowanalexander.com/calendar
> 
> 
> 
> 
> _______________________________________________
> Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> 





More information about the NumPy-Discussion mailing list