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"