Getting Started with Jupyter Notebooks¶
In this notebook, you will find:
- Information about running ShapeWorks Jupyter notebook tutorials
- Basics shortcuts for Jupyter notebooks
- Resources to help you with notebooks
ShapeWorks Jupyter Notebook Tutorials¶
What is Jupyter Notebook?¶
The Jupyter Notebook is a powerful tool to interactively prototype and present ideas and workflows. The Jupyter Notebook is an open source web application that enables you to create documents that contain runnable code, text, equations, and visualizations. Jupyter supports IPython kernel to allow you to write/prototype programs in Python. You can also use other kernels (e.g., R and Julia .. etc) with Jupyter notebooks.
The Jupyter Notebook combines three components:
- Notebook web app: An interactive web application to edit code in the browser, run code from the browser, see the results of running the code in the browser, create and use interactive widgets, and author narrative text and equations.
- Kernels: Processes launched by the notebook web app that runs code in a specific language and handles interactive widgets and tab completion. The default kernel runs Python code.
- Notebook documents: Documents that contain visible content in the notebook web app, including inputs and outputs of an interactive session, narrative text, equations, and images, and rich media representations of objects. Each notebook document has its own kernel. Notebook documents are files with a
.ipynbextension Internally, notebook documents are
jsondata with binary output encoded.
Running a Jupyter notebook tutorial¶
ShapeWorks installs Jupyter for you. The Jupyter Notebook is not included with Python. The
install_shapeworks script the comes with ShapeWorks (
install_shapeworks.sh for Mac OS and Linux and
install_shapeworks.bat for Window) installs Jupyter Notebook for you.
ShapeWorks also installs and enables for you
- a spell checker extension for the text cells
- a table of content extension to easily navigate notebooks
To get the server started, all you need to do is
- open up your terminal
- go to the folder where you would like to save your notebooks in
shapeworksenvironment by running
conda activate shapeworks
- launch the notebook server by running
Note: Notebooks for demonstrating ShapeWorks tools are located in
Examples/Python/notebooks/tutorials. We recommend that you create a folder in
Examples/Python/notebooks/ directory for your own notebooks.
The Jupyter notebook tutorials require ShapeWorks to be installed so that it can be imported at the beginning of every notebook. Try running the following code cell to make sure ShapeWorks can be imported:
Notebook keyboard shortcuts¶
Esc + H: displays a complete list of keyboard shortcuts
Esc + A: insert new cell above the current cell
Esc + B: insert new cell below the current cell
Esc + D + D: delete current cell
Esc + Z: undo
Shift + enter: run current cell and move to next
- To show a function's argument list (i.e., signature), use
shift-tab-tabto show more help for a function
- To show the help of a function, use
- To show all functions supported by an object, use
dot-tabafter the variable name
Jupyter Notebook Resources¶
- Documentation provided by Jupyter Notebook-Here you find all a comprehensive user documentation provided by the developers
- Jupyter notebooks are widely used by the python community and you can find many videos and blogs for new users.If you are facing any specific errors while starting and running the notebooks, please check out the following resources :
(a) Stack Overflow
(c) Stack Exchange