jupyter notebook显示每行代码

jupyter notebook/lab 默认输出只显示最后一行的变量
在文件的最上方添加:

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

即可输出显示每行代码

如果要恢复默认,改为如下即可:

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "none" 

猜你喜欢

转载自blog.csdn.net/weixin_44333597/article/details/109033870
今日推荐