[SciPy-user] output formatting of scipy arrays

Andrew Jaffe a.h.jaffe at gmail.com
Sat Dec 24 04:45:08 EST 2005


Hi all-

Sorry as usual if this is a faq, but is there any easy way to change the 
way arrays appear when printed (presumably, this means affecting the 
behavior of __str__?).

Currently, I get things like

[[ 1.          0.71375029  0.01215192 -0.90644004  0.02740346  0.66145675
    0.85629017  0.96413003  0.65755463]
  [...

when what I'd really prefer is something like

[[ 1.     0.714  0.012 -0.906  0.027  0.661  0.856  0.964  0.658]
  [...

Specifically, I'd like to get
   - less wide floating-point numbers
   - more entries per line

Thanks,

Andrew

p.s. I wonder if the first part of the request is something that's 
possible to change more-or-less globally -- i.e. for all float -> string 
conversions -- in python?




More information about the SciPy-User mailing list