Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to jump to the line containing an error in an iPython/Jupyter notebook?

When there is an error in a notebook, it simply spits out the error message below the code and one has to manually scan the output for the line in which the error occurred. I've been wondering whether there is maybe an extension or trick to automatically jump to the line containing the error. I have searched the web, but could not find anything.

like image 935
Lenar Hoyt Avatar asked Sep 03 '17 16:09

Lenar Hoyt


People also ask

How do you skip a line in a Jupyter Notebook?

Just add <br> where you would like to make the new line. Because jupyter notebook markdown cell is a superset of HTML. Note that newlines using <br> does not persist when exporting or saving the notebook to a pdf (using "Download as > PDF via LaTeX").

How do you run a specific line in a Jupyter Notebook?

To run a piece of code, click on the cell to select it, then press SHIFT+ENTER or press the play button in the toolbar above. Additionally, the Cell dropdown menu has several options to run cells, including running one cell at a time or to run all cells at once.

How do you jump to function definition in Jupyter Notebook?

Jump to definition of a variable or function in JupyterLab notebook and file editor. Use Alt + click to jump to a definition using your mouse, or Ctrl + Alt + B keyboard-only alternative.


1 Answers

You could try the pdb magic built in: http://ipython.readthedocs.io/en/stable/interactive/magics.html

like image 191
Tim P Avatar answered Sep 30 '22 18:09

Tim P