The Jupyter Notebook — Jupyter Notebook 6.4.11 Documentation

The Jupyter Notebook — Jupyter Notebook 6.4.11 Documentation

The notebook extends the console-bHarga Notebook Medan ased approach to interactive computing ina qualitatively new direction, providing a web-based application suitable forcapturing the whole computation process: developing, documenting, andexecuting code, as well as communicating the results.The Jupyter notebookcombines two components: Distributor Notebook Medan

A web application: a browser-based tool for interactive authoring ofdocuments which combine explanatory text, mathematics, computations and theirrich media output.

Notebook documents: a representation of all content visible in the webapplication, including inputs and outputs of the computations, explanatorytext, mathematics, images, and rich media representations of objects.Main features of the web application

In-browser editing for code, with automatic syntax highlighting,indentation, and tab completion/introspection.

The ability to execute code from the browser, with the results ofcomputations attached to the code which generated them.

Displaying the result of computation using rich media representations, suchas HTML, LaTeX, PNG, SVG, etc. For example, publication-quality figuresrendered by the matplotlib library, can be included inline.

In-browser editing for rich text using the Markdown markup language, whichcan provide commentary for the code, is not limited to plain text.

The ability to easily include mathematical notation within markdown cellsusing LaTeX, and rendered natively by MathJax.Notebook documents

Notebook documents contains the inputs and outputs of a interactive session aswell as additional text that accompanies the code but is not meant forexecution.In this way, notebook files can serve as a complete computationalrecord of a session, interleaving executable code with explanatory text,mathematics, and rich representations of resulting objects. These documentsare internally JSON files and are saved with the .ipynb extension. SinceJSON is a plain text format, they can be version-controlled and shared withcolleagues.

Notebooks may be exported to a range of static formats, including HTML (forexample, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, viathe nbconvert command.

Furthermore, any.ipynb notebook document available from a publicURL can be shared via the Jupyter Notebook Viewer Toko Notebook Medan your own static conversions with nbconvert,without relying on nbviewer.Notebooks and privacy

Because you use Jupyter in a web browser, some people are understandablyconcerned about using it with sensitive data.However, if you followed the standardinstall instructions,Jupyter is actually running on your own computer.If the URL in the address bar starts with http://localhost: orhttp://, it’s your computer acting as the server.Jupyter doesn’t send your data anywhere else—and as it’s open source,other people can check that we’re being honest about this.

You can also use Jupyter remotely:your company or university might run the server for you, for instance.If you want to work with sensitive data in those cases,talk to your IT or data protection staff about it.

We aim to ensure that other pages in your browser or other users on the samecomputer can’t access your notebook server. See Security in the Jupyter notebook server formore about this.Starting the notebook server

You can start running a notebook server from the command line using thefollowing command:

This will print some information about the notebook server in your console,and open a web browser to the URL of the web application (by default,

The landing halaman Open… menu option willopen the dashboard in a new browser tab, to allow you to open another notebookfrom the notebook directory or to create a new notebook.

You can start more than one notebook server at the same time, if you wantto work on notebooks in different directories.By default the firstnotebook server starts on port 8888, and later notebook servers search forports near that one.You can also Grosir Notebook Medan manually specify the port with the–port option.Creating a new notebook document

A new notebook may be created at any time, either from the dashboard, or usingthemenu option from within an active notebook.The new notebook is created within the same directory and will open in a newbrowser tab. It will also be reflected as a new Jual Notebook Medan entry in the notebook list onthe dashboard.Opening notebooks

An open notebook has exactly one interactive session connected to akernel, which will execute code sent by the userand communicate back results.This kernel remains active if the web browserwindow is closed, and reopening the same notebook from the dashboard willreconnect the web application to the same kernel. In the dashboard, notebookswith an active kernel have a Shutdown button next to them, whereasnotebooks without an active kernel have a Delete button in its place.

Other clients may connect to the same kernel.When each kernel is started, the notebook server prints to the terminal amessage like this:[NotebookApp] Kernel started: 87f7d2c0-13e3-43df-8bb8-1bd37aaf3373

This long string is the kernel’s ID which is sufficient for getting theinformation necessary to connect to the kernel. If the notebook uses the IPythonkernel, you can also see thisconnection data by running the %connect_info magic, which will print the same ID information along with otherdetails.

You can then, for example, manually start a Qt console connected to the samekernel from the command line, by passing a portion of the ID:$ jupyter qtconsole –existing 87f7d2c0

Without an ID, –existing willconnect to the most recentlystarted kernel.

With the IPython kernel, you can also run the %qtconsolemagic in the notebook to open a Qt console connectedto the same kernel.Notebook user interface

When you create a new notebook document, you will be presented with thenotebook name, a sajian bar, a toolbar and an empty code cell.

Notebook name: The name displayed at the top of the halaman,next to the Jupyter logo, reflects the name of the .ipynb arsip.Clicking on the notebook name brings up a dialog which allows you to rename it.Thus, renaming a notebookfrom “Untitled0” to “My first notebook” in the browser, renames theUntitled0.ipynb arsip to My first notebook.ipynb.

Menu bar: The menu bar presents different options that may be used tomanipulate the way the notebook functions.

Toolbar: The tool bar gives a quick way of performing the most-usedoperations within the notebook, by clicking on an icon.

Code cell: the default type of cell; read on for an explanation of cells.Structure of a notebook document

The notebook consists of a sequence of cells.A cell is a multiline text inputfield, and its contents can be executed by using Shift-Enter, or byclicking either the “Play” button the toolbar, or Cell, Run in the sajian bar.The execution behavior of a cell is determined by the cell’s type.There are threetypes of cells: code cells, markdown cells, and raw cells.Everycell starts off being a code cell, but its type can be changed by using adrop-down on the toolbar (which will be “Code”, initially), or viakeyboard shortcuts.

For more information on the different things you can do in a notebook,see the collection of examples.Code cells

A code cell allows you to edit and write new code, with full syntaxhighlighting and tab completion. The programming language you use dependson the kernel, and the default kernel (IPython) runs Python code.

When a code cell is executed, code that it contains is sent to the kernelassociated with the notebook.The results that are returned from thiscomputationare then displayed in the notebook as the cell’s hasil. Theoutput is not limited to text, with many other possible forms of hasil arealso possible, including matplotlib figures and HTML tables (as used, forexample, in the pandas data analysis package). This is known as IPython’srich display capability.Markdown cells

Leave a Reply