Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set number of digits for float point output in Ipython

Tags:

ipython

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?

like image 271
Cassio Pereira Avatar asked Feb 03 '23 01:02

Cassio Pereira


1 Answers

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.

like image 88
Jose Avatar answered Feb 08 '23 14:02

Jose