jupyterlab调试模式包含许多变量,它们是什么? [英] jupyterlab debugging mode contains many variables, what are they?

查看:119
本文介绍了jupyterlab调试模式包含许多变量,它们是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有jupyterlab最新版本3.0.14在调试模式下,右侧框中存在许多不需要的变量这些是什么?我想删除它们,但 i j result .

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.

推荐答案

您可以调整调试器的 variableFilters 设置以隐藏您不感兴趣的变量.有关更多详细信息,请参见此答案.

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

调试器仅显示内核在运行时可用的所有变量.Python内核(IPython和Xeus Python)具有记住每个执行单元的输入和输出的功能;如果您执行具有计算量大的任务的单元格,却忘记将结果分配给变量,例如,而不是:

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()

您这样做:

do_long_calculation()

在后一种情况下,您可以使用IPython下划线 _ 变量来缓存上一次执行结果以恢复输出:

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

result = _

如果您已经覆盖了最新的输出,则上一个输出将被保存到 __ ,依此类推.在输出缓存系统文档中了解有关此内容的更多信息.同样, _i _ii 等变量会缓存单元格的最新输入,因此您可以检查执行了什么.有关更多信息,请参见输入缓存系统文档.还有 In Out 变量,它们存储整个执行历史记录供您参考.

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.

这篇关于jupyterlab调试模式包含许多变量,它们是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆