Python——Jupyter notebook如何輸出多行結果


先執行:

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

永久更改方法:

在修改默認目錄時,cmd執行: jupyter notebook --generate-config 時,生成的文件夾 .ipython 中,

進入路徑:C:\Users\Administrator\.ipython\profile_default ,新建文件:ipython_config.py

輸入內容:

c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"
保存,關閉文件。

重啟 Jupyter notebook 后,即可直接多行結果輸出。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM