How to set number of digits for float point output in Ipython
In octave the output of float point n开发者_如何学运维umbers is limited by default to 4 digits (%.4f). Is there a way to set this behavior using IPython?
If you are using numpy a lot, then numpy.set_printoptions
lets you tweak that.
Another option is to use the magic %precision
command (only in IPython 0.11 or greater).
I guess that you can put your defaults in your startup configuration file.
%precision also takes a format argument, eg like this (gives you 2 digit precision and non-scientific format):
%precision %.2f
If you want to set the precision to 6 digits, try this:
%precision 6
精彩评论