Jupyter with IJulia


“The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.”

Jupyter offers an open-source (BSD-licensed), interactive computing environment for Python, Julia, R and other languages.

It was created in summer 2014 by the IPython development team to carry forward a vision of reproducible interactive computing for all programming languages:

  • Python
  • Julia
  • R
  • Ruby
  • Haskell
  • Scala
  • etc…

Need for Jupyter:

The minimum requirement to work with Julia in a scientific context is:

  1. An environment for editing and running Julia code
  2. The ability to generate figures and graphics

And a  very nice option that provides these features is Jupyter.

As an added bonus Jupyter also provides:

  • Widgets to manipulate and visualize data in real time.
  • Share notebooks with others using email, DropBox, GitHub and the Jupyter Notebook Viewer
  • It has support for over 40 programming languages, including those popular in Data Science such as Python, R, Julia and Scala.

 

ijulialogo.png

IJulia is a Julia-language back-end combined with the Jupyter interactive environment.

This combination allows you to interact with the Julia language using Jupyter’s powerful notebook, which combines code, formatted text, math, and multimedia in a single document.

Installing Jupyter using IJulia

In the previous blog,  we have already covered the installation of Julia.

Open Julia and run:

julia> Pkg.add("IJulia")

After installing Ijulia, the easiest way to check if your installation was successful is to run:

julia> using IJulia

julia> IJulia.notebook()

 

A web browser window would open with url: localhost:8888/tree

jup1

the page you are looking at is called the “dashboard”

If you click on “New” you should have the option to start a new Julia notebook

JuliaNewBook.png

Let’s try a very simple example in this Julia notebook using PyPlot.

jupytercode

Shutting down Jupyter

By simply closing the browser, it will not close you Jupyter Notebook App. You can reopen the previous address and the Jupyter Notebook App will be redisplayed.

When a notebook is opened, its kernel is automatically started. Closing the notebook browser tab, will not shut down the kernel, instead the kernel will keep running until is explicitly shut down. One needs to close the associated terminal to completely shut it down.

To shut down a kernel, the Notebook dashboard has a tab named Running which shows all the running notebooks and allows shutting them down(by clicking the shutdown button).

References:


KNOLDUS-advt-sticker

Advertisements

About Himani Arora

Software consultant at Knoldus Software LLP.
This entry was posted in knoldus and tagged , , , , , , , , . Bookmark the permalink.

2 Responses to Jupyter with IJulia

  1. Prabhat Kashyap says:

    Reblogged this on Prabhat Kashyap – Scala-Trek.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s