jupyterlab debugging mode contains many variables, what are they?

887 Views Asked by At

I have last version of jupyterlab Version 3.0.14 in debugging mode many variables not needed exists in the right box what are they? I want to delete them except i, j and result.

enter image description here

1

There are 1 best solutions below

6
On

You can adjust the variableFilters setting of the debugger to hide variable that you are not interested in; see this answer for more details.

The debugger simply shows all variables that are available at runtime in the kernel; the Python kernels (IPython and Xeus Python) come with a feature of remembering your input and output for each executed cell; it is immensely useful if you execute a cell with compute-intensive task but forget to assign the result onto a variable, for example instead of:

result = do_long_calculation()

you do:

do_long_calculation()

in the latter case you can use the IPython underscore _ variable which caches the last execution result to recover the output:

result = _

If you already overwritten the most recent output, it the previous one goes to __ and so on. Learn more about this in the output caching system documentation. Similarly _i, _ii, etc. variables cache most recent input of cells so you can check what has been executed. See more in input caching system documentation. There are also In and Out variables which store entire execution history for your reference.

Fur the future convenience I raised the idea of allowing regular expressions to hide all variables matching a pattern here.