The report can also be exported into an interactive HTML file with the afterward code.
A dash of magic
Magic commands are a set of acceptable functions in Jupyter Notebooks that are advised to solve some of the common problems in accepted data analysis. You can see all accessible magics with the help of %lsmagic
.
Magic commands are of two kinds: line magics, which are prefixed by a single %
character and accomplish on a single line of input, and cell magics, which are associated with the double %%
prefix and accomplish on assorted lines of input. Magic functions are callable after having to type the antecedent % if set to 1.
Let’s look at some of them that might be useful in common data assay tasks:
%pastebin uploads code to Pastebin and allotment the URL. Pastebin is an online agreeable hosting account where we can store plain text like source code snippets and then the URL can be shared with others. In fact, Github gist is also akin to pastebin albeit with adaptation control.
Consider a python script file.py
with the afterward content:
The %matplotlib inline
function is used to render the static matplotlib plots within the Jupyter notebook. Try replacing the inline
part with notebook
to get zoom-able & resize-able plots, easily. Make sure the action is called before importing the matplotlib library.
The %run
function runs a python script inside a notebook.
The %%latex action renders the cell capacity as LaTeX. It is useful for autograph algebraic formulae and equations in a cell.