Re: [Numpy-discussion] repr for numarray
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.
I vote for 3) too. Especially annoying is when I mistakenly type a.shape instead of a.shape() interactively. Without the parentheses I get a bound method, the repr of which includes the repr for the whole array, and when this has > 25 million elements it really is a drag to wait for it all to finish spewing out... Getting sidetracked... is this repr of methods a feature?
l = [1,2,3,4] l.sort
a = numarray.array(l) a.shape
It would seem more pythonic to get
participants (1)
-
Greg Ball