Lunski's Clutter

This is a place to put my clutters, no matter you like it or not, welcome here.

0%

Nbextension小技巧

什麼是jupyter nbextensions

Jupyter是個交互式IDE,方便學習,撰寫,呈現julia, python, r等程式,nbextensions是IDE的生產力工具。

當裝好Anaconda就自帶Jupyter了。

怎麼安裝

1
2
3
4
$ pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install  
$ jupyter notebook
就會在右邊tab顯示
[nbextensions](https://www.google.com/imgres?imgurl=https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1*Lei-MjkVmmTjq0XPG3PfSA.png&imgrefurl=https%3A%2F%2Fmedium.com%2F%40yanweiliu%2Fjupyter-notebook-nbextension%25E6%2593%25B4%25E5%2585%2585%25E5%25A5%2597%25E4%25BB%25B6-4e43a910402&docid=ZiXDSAbIGZm7PM&tbnid=y6W8L2sLXoVDBM%3A&vet=10ahUKEwiq8u3S1eDgAhWOv5QKHdo4D9AQMwg-KAAwAA..i&w=1600&h=739&safe=off&bih=547&biw=1237&q=nbextension&ved=0ahUKEwiq8u3S1eDgAhWOv5QKHdo4D9AQMwg-KAAwAA&iact=mrc&uact=8)

推薦不錯的nbextensions

1.Table of Contents管理cell
2.Autopep8自動格式化 須先pip install autopep8
3.variable inspector管理變數
4.ExecuteTime儲存格耗時
5.Hinterland下拉選單
6.Split Cells Notebook拆分cell
7.Collapsible headings折疊程式區塊
8.Code folding折疊範圍在函數內部程式碼
9.Notify執行完成瀏覽器通知
10.jupyter簡報展示
pip install RISE
jupyter-nbextension install rise –py –sys-prefix
jupyter-nbextension enable rise –py –sys-prefix

小技巧

1.開頭打!指令 可以直接執行bash指令
2.help(可以查看說明文擋)
3.shift+tab查看函數用法
4.tab看有什麼函數可用
5.尋找取代:對cell按f可以取代這個cell所有找尋的字
6.Multicursor:按著windows:alt|mac:option就可以選取多行,像notpad++
7.快速開啟虛擬環境:其實就是在linux:.bashrc|mac:.bash_profile加上alias py36=’conda activate py36’再source .bash_profile以後就只要打py36就能快速開啟虛擬環境了
8.Shell Commands:
就是用過colab的人都知道的!+[指令]
9.寫公式:
\begin{align}
…latex…
\end{align}
10.Magic commands:
%%latex
%%bash
%%HTML
%%python2
%%python3
%%ruby
%%perl

Jupytext單元格轉文字方便貼到Pycharm

https://github.com/mwouts/jupytext/blob/master/README.md#installation

nbviewer: 線上瀏覽 ipynb中的內容

https://medium.com/@yanweiliu/nbviewer-%E7%B7%9A%E4%B8%8A%E7%80%8F%E8%A6%BD-ipynb%E4%B8%AD%E7%9A%84%E5%85%A7%E5%AE%B9-7cf7ff6d5b70


如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚)

Welcome to my other publishing channels