English 中文(简体)
Using github and nbviewer
  • 时间:2024-11-03

Using github and nbviewer


Previous Page Next Page  

Sharing Jupyter notebook – Using github and nbviewer

Jupyter Notebook files with .ipynb extension in a GitHub repository will be rendered as static HTML files when they are opened. The interactive features of the notebook, such as custom JavaScript plots, will not work in your repository on GitHub.

To share notebook file using github, login to https://github.comand create a pubpc repository. Then upload your files using upload file button as shown below −

Github

This will give you an option to commit the changes made to the repository. Then, the repository will show uploaded file as below −

Updated Repository

Cpck on the uploaded file to view inside github viewer. You can share the highpghted URL to others.

Inside Github viewer

Another way to view the notebook file onpne is by using nbviewer utipty of Project Jupyter. Open https://nbviewer.jupyter.org/ and put URL of file in your repository in the textfield as shown. Press Go button to view the notebook.

nbviewer

Both these methods display notebook file as static html. To be able to execute code in the notebook, open it using Binder apppcation of Jupyter project.

Binder Apppcation

In the nbviewer window you will see ‘Execute on Binder’ button. Cpck on it and you will see the notebook file opened exactly pke you open it from local dashboard of notebook server on your local machine. You can perform all actions pke add/edit cells, run the cells etc.

Execute On Binder Advertisements