Reputation: 439
In octave the output of float point numbers is limited by default to 4 digits (%.4f). Is there a way to set this behavior using IPython?
Upvotes: 9
Views: 21393
Reputation: 361
%precision also takes a format argument, eg like this (gives you 2 digit precision and non-scientific format):
%precision %.2f
Upvotes: 5
Reputation: 9
If you want to set the precision to 6 digits, try this:
%precision 6
Upvotes: 0
Reputation: 2129
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.
Upvotes: 10