On 2006-12-02, Robert Kern <[EMAIL PROTECTED]> wrote: > Beliavsky wrote: >> When I print an array in any language, I (and I think most programmers) >> expect by default to have all elements displayed. Matlab, R, and >> Fortran 95 have somewhat similar arrays to numpy, and that is what they >> do. I don't remember Numeric summarizing arrays by default. R has a >> "summary" function as well as a "print" function. > > There are pretty serious problems with interactive use and large arrays. > Formatting the string for a very large array can take a fair bit of time, > often > much more than the computation that generated it. This has been a > long-standing > frustration of many Numeric users. At the interactive prompt, if the statement > you just entered is taking a long time to execute and you Ctrl-C, odds are, > the > traceback points you right in the middle of array2string(), not anything in > the > actual computation itself. Since the interactive prompt prints things out > without the user explicitly asking for it, it's not enough simply to have two > functions available. > > numarray set the default to summarize, and numpy kept numarray's choice.
I 100% approve of the summarization by default. It has saved me *many* times. Dave -- http://mail.python.org/mailman/listinfo/python-list