Difference: IPython (50 vs. 51)

Revision 512022-06-02 - WilliamSeligman

Line: 1 to 1
 
META TOPICPARENT name="Computing"

Jupyter notebook server at Nevis

Line: 12 to 12
 

The basics

Changed:
<
<
When you visit notebook for the first time, you'll see your home directory. You can perform some elementary file operations from this screen: check the box next to a filename, and you'll see an option near the top of the screen to rename or delete the file. The "Upload" button near the top left allows you to copy files from the computer you're using to the Nevis cluster.
>
>
When you visit notebook for the first time, you'll see your home directory on the left-hand panel. You can perform some elementary file operations from here: right-click on a file's name to see a menu.
 
Changed:
<
<
To start a notebook, click on the "New" button near the top left and select one of the "kernels". (Underneath the kernel list: selecting "Text File" will give you a basic text editor and "Terminal" will give you a terminal emulator; see this page for more information.)

To "execute" the contents of a given cell within the notebook, hit SHIFT-ENTER with your cursor in that cell. I strongly suggest that you look at the Help menu. The User Interface Tour only takes a minute, and the Keyboard Shortcuts will be handy.

>
>
You'll see a bunch of kernel icons to the right. To start a notebook, click on the one of the icons in the "Notebook" section that corresponds to the language or function you want to use; there's a list of kernels below. In the "Other" category, you'll see a Terminal icon if you'd like to type UNIX commands from within the web browser. The "Text File" icon will open a simple text editor. (The options under "Console" can be ignored for first-time users.)
 

Why notebooks?

Added:
>
>
After you've started a notebook, type some elementary commands in one of the notebook cells. For example, if you picked "Python 3":

from ROOT import TH1D, TCanvas
my_canvas = TCanvas("mycanvas","canvas title",800,600)
example = TH1D("example","example histogram",100,-3,3)
example.FillRandom("gaus",10000)
example.Draw("E")
my_canvas.Draw()
 Type some commands in the language of the kernel you chose in the first cell (there are code examples below). Hit SHIFT-ENTER to execute the lines in that cell. If there's an error, make an appropriate fix and hit SHIFT-ENTER again.

Continue editing lines in that first cell until you have finished some small task (e.g., creating a histogram). Execute the cell (SHIFT-ENTER) to demonstrate to yourself that you've got it right.

Go to the next cell and continue your work. The variables and functions you defined in the first cell are still available to you. Again, you can iteratively execute and debug that new set of code until it does what you want.

Changed:
<
<
In the File menu, select "Rename..." (otherwise your notebook will have the name "Untitled"). On your main Jupyter page, you'll see your new notebook in your home directory, with the suffix .ipynb. Click on it to start up the notebook again.
>
>
In the File menu, select "Rename Notebook..." (otherwise your notebook will have the name "Untitled"). On the left-hand display you'll see your new notebook in your home directory, with the suffix .ipynb. Click on it to start up the notebook again.
  Explore the menus. Note how you can save, rename, checkpoint, switch kernels, execute some or all of the cells.
Line: 52 to 61
  That last magic command, %jsroot on, is only available in ROOT notebooks (the first two kernels listed below). JSROOT adds some interactivity to ROOT plots.
Deleted:
<
<

JupyterLab

JupyterLab is an alternative way of managing files and notebooks. It will eventually become the standard interface for Jupyter.

To see what JupyterLab can do, look at your Jupyter URL and replace the final 'tree' with 'lab'. For example, if you see the URL

https://jsmith.notebook.nevis.columbia.edu/user/jsmith/tree

change it to

https://jsmith.notebook.nevis.columbia.edu/user/jsmith/lab

If you like JupyterLab and want it to be the default when you start Jupyter, edit/create the file ~/.jupyter/jupyter_notebook_config.py and add the line:

c.NotebookApp.default_url = '/lab'

 

Handy Jupyter links

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback