99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2018-10-26 閱讀量: 12986
如何設(shè)置jupyter notebook多行輸出?

看到網(wǎng)上有代碼截圖,jupyter notebook可以多行輸出,怎么設(shè)置呢?

1、臨時方法

在notebook執(zhí)行代碼之前首先需要先執(zhí)行下面代碼以設(shè)置InteractiveShell.ast_node_interactivity參數(shù)

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

這個方法的作用范圍僅限當(dāng)前kernel(一個.ipynb文件對應(yīng)一個kernel)

2、永久方式-更改配置文件

創(chuàng)建 配置文件 ipython-config.py ipython-kernel-config.py

ipython profile create 

輸入命令后創(chuàng)建了兩個配置文件,終端打印信息中有文件的完整路徑信息

使用文本編輯器編輯ipython_config.py,Ctrl + F 查找 c.InteractiveShell.ast_node_interactivity ,將'last_expr'改為''all。注意將此行前的井號去掉,不然這行還是被注釋的。然后保存文件重啟jupyter notebook。

53.8969
4
關(guān)注作者
收藏
評論(3)

發(fā)表評論
374915689
2018-10-27
666
0.0000 0 0 回復(fù)
山轉(zhuǎn)水轉(zhuǎn)
2018-10-27
博主厲害了。收藏
0.0000 0 0 回復(fù)
PGC123
2018-10-26
由于版本問題,如果第二種方法不能生效則在ipython-kernel-config.py修改,其他做操一致。
0.4667 2 0 回復(fù)
學(xué)無止境
2018-11-19
感謝!
0.0000 0 0 回復(fù)
推薦帖子
條評論