bundles / IPython 9.11.0 / IPython / core / magics / basic / BasicMagics / precision
function
IPython.core.magics.basic:BasicMagics.precision
Signature
def precision ( self , s = '' ) Summary
Set floating point precision for pretty printing.
Extended Summary
Can set either integer precision or a format string.
If numpy has been imported and precision is an int, numpy display precision will also be set, via numpy.set_printoptions.
If no argument is given, defaults will be restored.
Examples
:: In [1]: from math import pi In [2]: %precision 3 Out[2]: '%.3f' In [3]: pi Out[3]: 3.142 In [4]: %precision %i Out[4]: '%i' In [5]: pi Out[5]: 3 In [6]: %precision %e Out[6]: '%e' In [7]: pi**10 Out[7]: 9.364805e+04 In [8]: %precision Out[8]: '%r' In [9]: pi**10 Out[9]: 93648.047476082982Aliases
-
IPython.core.magics.BasicMagics.precision