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

Minjae Kim the.minjae at gmail.com
Sat Apr 11 23:54:52 EDT 2009


Hello,

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.

Best,
Minjae
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090411/ef305345/attachment.html>


More information about the NumPy-Discussion mailing list