Jupyter Notebook介紹及安裝說明

MAPE Academy
May 24, 2018 · 7 min read

2021全新內容歡迎參考文章 Jupyter Notebook完整介紹、安裝及使用說明

Jupyter Notebook介紹

Image for post
Image for post
Photo by Jupyter Documentation

Jupter Notebook您可以把它想像成是上述所講的IPython + Notebook整合架構,它是一個介於編輯器(例如Atom)及IDE(Spider、PyCharm、Vim) 之間的應用環境,可讓您編寫程式時利用其直譯式的特性,達到高互動執行結果,並且很容易呈現資料視覺化的執行。Jupyter Notebook包含了兩個組成: Web ApplicationNotebook Documents

  • 網頁應用(Web Application):基於瀏覽器(web-based)的互動創作及應用工具,包括可以計算、數學、文檔創作及豐富的多媒體輸出。
  • 文檔顯示(Notebook Documents):顯示所有在上述Web Application當中的內容,包括計算的輸入/輸出、文件說明/解釋、數學運算及式子、圖片及所有豐富多媒體內容。

Jupyter Notebook安裝

Image for post
Image for post

安裝前的準備:Python

使用Anaconda安裝

使用pip安裝

  • Python 3版本

先進行pip版本升級(建議)

pip3 install — upgrade pip

進行安裝

pip3 install jupyter
  • Python 2版本

先進行pip版本升級(建議)

pip install — upgrade pip

進行安裝

pip install jupyter

jupyter notebook安裝好後若要開始執行Jupyter Notebook,您可以從Windows開始選單(Start menu)中選擇Jupyter Notebook(如下圖)

Image for post
Image for post

或是在終端模式(Mac/Linux) or 命令提示模式(Windows)執行下列命令,同樣可以使用Jupyter Notebook了。

jupyter notebook

您就可以開啟Jupyter Notebook(如下圖),點選New並選擇您已安裝的Python 3就可以開始使用了。

Image for post
Image for post

在開始使用之前,先對Jupyter Notebook整個使用介面,做一個完整的介紹如下。

Jupyter Notebook使用介面

Image for post
Image for post

命令模式(Command Mode)

Image for post
Image for post

編輯模式(Edit Mode)

Image for post
Image for post

儲存及載入(Saving/Loading)

Image for post
Image for post

程式碼及文本撰寫功能

  • Edit
Image for post
Image for post
  • Insert
Image for post
Image for post
  • Executing
Image for post
Image for post
  • View
Image for post
Image for post

使用指南(Help)

Image for post
Image for post

小工具(Widgets)

Image for post
Image for post

與不同的程式語言溝通

Image for post
Image for post

安裝Jupyter Notebook時將會自動安裝IPython kernel。其它介面功能介紹如下圖:

Image for post
Image for post

了解Jupyter Notebook之後,您將可以更快速及便利的開始學習撰寫有關的程式,邁向Data Science的學習之路又前進一步了。2021 更新版內容歡迎參考文章 Jupyter Notebook 完整介紹、安裝及使用說明

Python4U

Science, Travel and Reading

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store