[Numpy-discussion] Preserving trailing zeros when printing an array

Minjae Kim the.minjae@gmail....
Sat Apr 11 22:54:52 CDT 2009


When I work with arrays, I would like to print trailing zeros also.

Somehow, Numpy refuses to print trailing zeros of a number within an array.
For example, if I set the print precision to 5 decimal digits
(set_printoptions(5)) and try to print array([0.10000001], it gives me 0.1
instead of 0.10000 . I would like to see all trailing zeros when I print it
on the shell (up to a predefined number of digits). (This is confirmed with
Numpy functions like array2string and array_str)

Any help is welcome.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090411/ef305345/attachment.html 

More information about the Numpy-discussion mailing list