Search code examples
pythonjupyter-notebookanacondadocstring

The help tab opened by shift+tab in jupyter notebook doesn't render the docstring of a method/function properly


I am trying to read the documentation(docstring) of a function or method using the important shortcut of jupyter notebook "shift+tab" but it doesn't render the text properly. For example, on looking the docstring of confusion_matrix function:

enter image description here

You can see the highlighted part that I am getting those weird text rendered( math: ) before actual text. This makes it hard to read the docstring. I want it to render it like the documentation of sklearn like this, enter image description here

I feel like some library isn't loaded or downloaded. I am new to using jupyter notebooks, so please be kind :)

PS: I have tried restarting the theme also but it didn't work


Solution

  • .. math:: is an rst markup.

    They have mentioned in the "under-progress" repo that Docstring doesn't support Mathematical notations, as they are written in -rst format.

    Frankly, there is no support added for reStructuredText in Jupyter as of now, hence you would have to search ways to manually apply for the support. Check out @akaihola's attempt on a comparative issue.