Dan*_*ppo 23 ipython jupyter jupyter-notebook jupyter-lab
在 jupyter notebook 中,我可以使用nbextensions配置自动单元计时,结果如下:

我怎样才能在 jupyter实验室中做到这一点?我没有找到任何做类似事情的扩展。
Obs.:我知道用%%time魔法可以达到类似的结果,但我希望它是自动的,所以我不必在每个单元格的开头放置魔法函数。
小智 31
JupyterLab >= 2.0.2
让我们一步一步来
jupyterlab-执行时间
首先启用扩展管理器
启用后,您会在“扩展管理器”末尾的侧任务栏中看到新按钮
您还可以通过以下步骤启用它:
由于未确认免责声明,您可以搜索扩展,但无法安装它(没有安装按钮可用)。

要安装扩展程序,您首先必须明确承认免责声明。完成后,这将跨会话保留,用户无需再次检查。
搜索 jupyterlab-execute-time
安装启用
启用后,您必须重建它:在它上面打开一个小弹出窗口,单击 Rebulid;
然后你必须重新启动内核
你仍然发现你将无法看到你想要的:
注意:要显示任何内容,您需要通过 Settings->Advanced Settings Editor->Notebook: {"recordTiming": true} 在笔记本中启用单元计时
最后“recordTiming”=true
并保存在右端!
Dar*_*eam 31
感谢@welcome_back 的回答,但您不必打扰 jupyter 扩展管理器,特别是如果您担心该警告的话。
!pip install jupyterlab_execute_time{"recordTiming": true}
Run Code Online (Sandbox Code Playgroud)
Zvi*_*Zvi 16
无需延期。
只需使用(在任何单元格):
try:
%load_ext autotime
except:
!pip install ipython-autotime
%load_ext autotime
Run Code Online (Sandbox Code Playgroud)
要停止单元计时,请使用:
%unload_ext autotime
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8928 次 |
| 最近记录: |