3

Is it possible to configure a jupyter notebook to round floats by default so that I don't always see something like the following (I'd prefer to see -0.30 in this case):

enter image description here

RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
  • 1
    Maybe start with [this](https://stackoverflow.com/questions/1566936/easy-pretty-printing-of-floats-in-python) although it looks scary. But i would lean to just define some extra print function and call this manually or incorporate in some clever way where it's needed. – sascha May 30 '17 at 20:37
  • Thanks @sascha - I saw that. I'm hoping there is a way to configure jupyter itself so that I don't have to jump through formatting hoops. – RobertJoseph May 30 '17 at 20:44
  • Something like this but for displaying floats: https://jupyter-notebook.readthedocs.io/en/latest/frontend_config.html#frontend-config – RobertJoseph May 30 '17 at 20:47
  • 1
    I get the idea and i know you can tune a lot of stuff. But i'm not sure if such a low-level thing is customizable or if it's just passed through straight from the interpreter (which would not surprise me). Sadly i can't help here. But maybe some else can. (Side-note: if those would be 1x1 numpy-arrays instead of python-floats, there is support within numpy; but again, it's awkward in your case) – sascha May 30 '17 at 20:49

0 Answers0