jupyter notebook displays each line of code

The default output of jupyter notebook/lab only displays the variables
in the last line. Add at the top of the file:

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

You can output and display each line of code

If you want to restore the default, just change it as follows:

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

Guess you like

Origin blog.csdn.net/weixin_44333597/article/details/109033870