Jupyter Notebooks

Jupyter Notebooks and their underlying eco-structure the Jupyter Server and Hub are truly amazing open source software creations.
So what is it? The terminal window of the future here today? An integrated programming environment. A way to run and document code experiments in a note book form. A way to distribute your code experiments to others in a way that just runs without all of the normal 'do they have the proper libraries installed on their machines' issues. Some crazy rethink of what a Mathematica notebook could be? All of the above and more.

Jupyter Notebooks are an interactive environment for writing and running code.

So it's an IDE (integrated Development Environment), right?  Ahhhh, not really in the normal sense of how you think of IDE's and how they usually work.  Throw away whatever metaphors bloated Visual Studio and Xcode were built off of.  'Notebook' is the new metaphor. And boy is it powerful.

Your code can be in different languages. And the kernel associated with the language you are using is basically built into the notebook. So the notebook is really a very sophisticated software container.

But the notebook container holds a lot more than just your code and the kernel it runs on. The notebook is also a readable and editable document. And that is the key point of this new metaphor for working with code. You are authoring a readable and executable document. One that is really designed to encompass the entire development - documentation - execution process associated with interactive computation in the form of a smart rich media document that is also a web based application if you want it to be.

Because Jupyter Notebooks are self contained, they can easily be passed around to different people. Or even accessed and shared among groups of people remotely using the Jupyter server. Everything in the notebook is stored in an easy to read standardized JSON format.

Because Jupyter Notebooks are documents, they can display Html, LaTex, PNG, SVG, matplotlib
Notebook content can also be exported using the nbconvert command to structured text, LaTex, PDF, etc.  In effect, the Jupyter Notebook Viewer nbviewer is simply nbconvert run as a web service. Very clever. Very smart.

We will be discussing and using Jupyter Notebooks in future posts.

And you should really check them out for playing around and working with Python coding.

In honor of Walter Bender's great love of the Mandelbrot fractal, let's take a look at a Jupyter Notebook that generates it.

I found a nice Mandelbrot set explorer notebook on Githib. So you will notice that the Jupyter Notebook .ipynb file sort of renders as html on Github. It's missing the plots and some other stuff.  And you can't interactively run it.

But wait. All you have to do it copy and past the Github link into the appropriate place at the top of nbviewer.jupyter.org and voila, here you go with a full static html version of the notebook that displays all of the plots in a web browser.

In theory, if you then press the Binder button at the top of the page, it will run a live interactive version of the notebook using binder in your browser. In hindsight, probably should have picked a simpler example notebook for this, but i think you get the idea.

You will of course want to install Jupyter on your computer if you are going to seriously get into this. You can then work interactively with the notebooks directly on your computer.


Popular posts from this blog

Pix2Pix: a GAN architecture for image to image transformation

CycleGAN: a GAN architecture for learning unpaired image to image transformations

Smart Fabrics