大鄧強力推薦-jupyter notebook使用小技巧

1. 快捷鍵
在jupyter notebook菜單欄有Help按鈕,能夠查看jupyter的快捷鍵node

大鄧強力推薦-jupyter notebook使用小技巧

2. 將多個變量輸出
通常jupyter notebook默認只打印最後一個變量的結果。好比shell

大鄧強力推薦-jupyter notebook使用小技巧

大鄧強力推薦-jupyter notebook使用小技巧
經過設置InteractiveShell.astnodeinteractivity參數爲all,就能夠讓全部的變量或者聲明都能顯示出來
大鄧強力推薦-jupyter notebook使用小技巧
大鄧強力推薦-jupyter notebook使用小技巧瀏覽器

3. 問號?
除了Help菜單能讓咱們快讀查看numpy、pandas、scipy和matplotlib庫,其實在cell中使用 ?能夠查看庫、函數、方法和變量的信息。markdown

大鄧強力推薦-jupyter notebook使用小技巧
大鄧強力推薦-jupyter notebook使用小技巧
大鄧強力推薦-jupyter notebook使用小技巧
4. 在notebook中畫圖
做圖最經常使用的就是matplotlib,記得在cell中寫上這句ide

大鄧強力推薦-jupyter notebook使用小技巧
大鄧強力推薦-jupyter notebook使用小技巧

5. IPython魔法命令
大鄧強力推薦-jupyter notebook使用小技巧函數

查看當前工做目錄命令行

%
pwd

執行上面的代碼,獲得3d

'/Users/suosuo/Desktop/20180820 jupyter notebook技巧'

更改當前工做目錄code

大鄧強力推薦-jupyter notebook使用小技巧
查看目錄文件列表
大鄧強力推薦-jupyter notebook使用小技巧
大鄧強力推薦-jupyter notebook使用小技巧blog

大鄧強力推薦-jupyter notebook使用小技巧
6. 執行shell命令

命令行的命令前面加個 !便可在notebook中進行。

好比咱們想要安裝jieba庫,須要打開終端輸入
大鄧強力推薦-jupyter notebook使用小技巧

7. markdown標記語言
大鄧強力推薦-jupyter notebook使用小技巧
一級標題

# 一級標題

二級標題

## 二級標題

三級標題

### 三級標題

有序列表

元素1

元素2

元素3

大鄧強力推薦-jupyter notebook使用小技巧

大鄧強力推薦-jupyter notebook使用小技巧

會被MathJax渲染成

大鄧強力推薦-jupyter notebook使用小技巧

大鄧強力推薦-jupyter notebook使用小技巧

大鄧強力推薦-jupyter notebook使用小技巧

大鄧強力推薦-jupyter notebook使用小技巧

而在.ipynb文件中增長了下圖的這個按鈕,點擊該按鈕咱們就能夠使用jupyter的展現功能(瀏覽器PPT功能)

大鄧強力推薦-jupyter notebook使用小技巧

!
pip3 install jupyter_contrib_nbextensions

!
jupyter contrib nbextension install 

!
jupyter_contrib_nbextensions
相關文章
相關標籤/搜索