Jupyter Notebook is a feature that allows you to create web pages (documents) that contain Python code.
Python code is properly executed as Python code rather than simple text, so you can save the executable code and its results together. What's more, it's a perfect tool for publishing / sharing commentary with rich decorations on web pages.
nbviewer is a site where you can refer to the Jupyter Notebook posted on Github / Gist, and you can see how it will look like.
There is no way not to use this, so I will explain how to use it.
pip install jupyter
After the installation, the following command will start the Jupyter Notebook server and allow you to create documents.
jupyter notebook
In addition, when handling with a calculation library such as Numpy, I think that it is better to use Anaconda or Miniconda (especially in the case of Windows). In my environment, I set it up using conda from Miniconda.
Basically, you will be working in the folder where you ran jupyter notebook
, so start it in the directory where you want to save the files.
When you start it, you will see the following screen. Let's create a file from the New Notebook (choose Python 3).
Jupyter Notebook builds documents in units called Cell. There are types such as Python code and Markdown text in this Cell, so select the appropriate one and create a document.
By pressing the execute button, the Python code will be executed and Markdown will be displayed.
When you save it, it will be saved in the ʻipynb` format. After that, it will be in the form of creating more and more documents. You can share the created Book with nbviewer, but in the case of GitHub, it will be displayed as it is.
With this, it will be possible to share analysis methods etc. with a Python code base that can be executed and with explanations, so I think that it will be very useful for sharing know-how.
Recommended Posts