此篇參考並縮寫幾個覺得寫得很詳細完整的教學,文內附上連結與出處。
Jupyter Notebook是一個介於編輯器及IDE之間的應用環境,能以網頁形式,讓使用者在瀏覽器中以互動式計算的方式,撰寫及執行程式碼。加上容易呈現資料視覺化的執行、易於分享等諸多優點,許多資料分析、機器學習的討論都會以Jupyter Notebook的形式呈現。
Jupyter Notebook is kind of an inbetween of a text editor and IDE. It is web-based and let users write and run codes easily with an intuitive way with it’s interactive computing system and the ability to instantly show results. Furthermore, it’s also super easy to visualize data and to share. With all these merits mentioned above and many others, many people in the field of Data Science and Machine Learning use it to share thoughts and communicate.
安裝Jupyter Notebook步驟:
Steps of installing Jupyter Notebook:
安裝完成後,就可以從Windows開始選單中點選開啟Jupyter Notebook。
After installing Anaconda, now you can start Jupyter Notebook in Windows from Start.
運行介面如下,點選New並選擇Python 3開始一個新的檔案。
The interface is as below, click New and choose Python 3 to start a new file.
Jupyter Notebook的編輯介面主要有下面四部分:
File Name 檔名(點擊即可重新命名)、Menu 主選單、Toolbar 工具列、Cell 編輯單元。工具列右側有一個下拉選單能選擇目前要增加的Cell模式,介紹常用兩種:
There are 4 main sections in Jupyter Notebook, File Name (click on it to rename), Menu, Toolbar, and Cell. On the right side of the toolbar, there is a drop down menu to change the mode of cell you’re now adding. Two frequently used are:
Functions of buttons:
命令模式(如上圖藍色框框)、編輯模式(如下圖綠色框框)
Command Mode (shown as above in blue square), Edit Mode (shown as below in green square)
Executing 執行程式碼
Cell選單下拉會看見不同執行方式,執行前可以稍微注意一下目前選定的是哪個Cell。個人習慣使用(Ctrl + Enter)執行當前Cell並進入命令模式,(Alt + Enter)執行所有當前Cell並在下方新增一個Cell。
Under the drop down menu of Cell, there are different ways to run Cells. Better check you are selecting the cell that you want to run before doing it. Personally I prefer to use hot keys - Ctrl+Enter to run the selected cell and enter command mode; Alt+Enter to run the current cell and inserts a new one below.
附上圖片來源、介面完整介紹以及其他操作解說傳送門。
題外話,在查找資料時才知道原來Jupyter Notebook的名子是結合其支持的三種核心程式語言Julia、Python和R。
Just found out that the name of Jupyter Notebook comes from the three main languages it supports - Julia, Python, and R, while looking up information for this article.
文中若有錯誤還望不吝指正,感激不盡。
Please let me know if there’s any mistake in this article. Thanks for reading.
Reference 參考資料:
[2] 資料分析&機器學習 第1.2講:Jupyter Notebook介紹
[3] Jupyter Notebook for Beginners: A Tutorial
[4] Jupyter Notebook介绍、安装及使用教程
[5] Anaconda介紹及安裝教學
[6] 圖片來源
[7] 2. Markdown & LaTeX - Jupyter Tutorial (IPython 3)
[9] 用 Markdown 做筆記