<jupyter_start><jupyter_text>Introduction to Jupyter Notebook*<NAME>**2018-05-14*This is a minimal working example of jupyter notebook. It's used to demostrate some of it's very basic functions.**Jupyter notebook** is a literature programming tool which is a combination of a Read–Eval–Print Loop (REPL, for example a shell / python interpreter) and a authoring interface for documentation purpose. Installation1. Install Anaconda. https://docs.anaconda.com/anaconda/install/2. Install jupyter notebook. If you use Windows, you might want to install using `Anaconda Navigator` https://docs.anaconda.com/anaconda/navigator/. If you use UNIX, you can do it using `conda install jupyter notebook`. After that, you can start jupyter notebook using command line `jupyter notebook` in a terminal. A browser window will be opened showing the current directory, and you can create new `.ipynb` files using it.3. (Optionally) install editors to get a better authoring experience.    1. `nteract` https://nteract.io/desktop , which provide "double click to open notebook" and "latex live preview". It's more suitable for document editing.    2. Text editors like Atom (through `hydrogen` plugin) or Emacs (through EIN plugins or org-mode). Those will provide better integration with Git and better data analysis / coding experience. Introduction to formatThe basic unit in a jupyter notebook file is "cell", which is a chunk of text/code. The two most commonly used types of cell are "markdown cell" and "code cell". If you haven't heard of markdown, it's basically a minimal markup syntax, used for easily enter markups like **bold**, *italic*, ~~strike out~~ and  $inline\ formul\alpha$ or display-style $$\mathbb{E}\mathrm{quations}$$Code cell is easy to understand: they are short, executable code snippets. A code cell can be "executed" by press `Shift-return`, which is not much different from you copy-paste the code into a shell/interpreter and press return to run.An example:<jupyter_code># load numpy library
import numpy as np
# load matplotlib library for scientific plotting
import matplotlib.pyplot as plt
%matplotlib inline
# generate a 2D gaussian random variable, represented using (x,y)
x, y = np.random.multivariate_normal([0, 0], [[2, 4], [4, 10]], 5000).T
plt.plot(x, y, '.')
plt.axis('equal')
plt.show()<jupyter_output><empty_output><jupyter_text>Another example:<jupyter_code># copied from https://plot.ly/python/3d-scatter-plots/
# a 3D scatter plot example

# load interactive ploting lib `plotly`
from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
import plotly.graph_objs as go

# This can be comment out as session is shared between cells
import numpy as np

# generate 3D gaussian
x, y, z = np.random.multivariate_normal(np.array([0,0,0]),
                                        np.array([[1,0,0],
                                                  [0,1,0],
                                                  [0,0,1]]), 400).transpose()

# plot
trace1 = go.Scatter3d(
    x=x,
    y=y,
    z=z,
    mode='markers',
    marker=dict(
        size=4,
        color=np.sqrt(x*x+y*y+z*z),                # set color to an array/list of desired values
        colorscale='Viridis',   # choose a colorscale
        opacity=0.8
    )
)

data = [trace1]
layout = go.Layout(
    margin=dict(
        l=0,
        r=0,
        b=0,
        t=0
    )
)
fig = go.Figure(data=data, layout=layout)
iplot(fig, filename='3d-scatter-colorscale')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0961322869955157, 'fraction_numerical': 0.015134529147982063, 'mean_word_length': 3.5639386189258313, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '255902', 'license': 'MIT', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1045, 'n_words': 407, 'path': 'intro_to_jupyter_notebook.ipynb', 'repo_name': 'kevingroup/techniXnippets', 'size': '3574'}