美文网首页
jupyter 使用技巧之 magic 命令

jupyter 使用技巧之 magic 命令

作者: 田丰w | 来源:发表于2023-02-15 14:19 被阅读0次

%debug 激活 ipdb 调试

在报错后的下一个 cell 里执行 %debug, 可以激活 ipdb 交互调试窗口

%lsmagic 列出所有 magic 命令

?<函数或类> 显示文档

打印中间结果的输出

一个cell中,一行命令放置一个变量,默认只输出最后一个这种命令的结果

配置kernel显示所有交互输出结果

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity='all'

alt+拖动鼠标激活 Multicursor(列模式)

有用的插件

  1. ExecuteTime
    在cell底部给出结果生成的用时和结束时间
    pip install jupyterlab_execute_time
    https://github.com/deshaw/jupyterlab-execute-time

参考:
magics命令: https://ipython.readthedocs.io/en/stable/interactive/magics.html

相关文章

网友评论

      本文标题:jupyter 使用技巧之 magic 命令

      本文链接:https://www.haomeiwen.com/subject/bzzykdtx.html