# Jupyter Notebook — Interactive Computing Environment for Data Science > Jupyter Notebook is the original interactive computing environment where you can combine live code, equations, visualizations, and narrative text in a single document. It supports 40+ languages and is the standard tool for data exploration, teaching, and research. ## Install Save in your project root: # Jupyter Notebook — Interactive Computing Environment for Data Science ## Quick Use ```bash # Install Jupyter pip install notebook # Launch Jupyter Notebook jupyter notebook # Or install JupyterLab (modern interface) pip install jupyterlab jupyter lab ``` ## Introduction Jupyter Notebook is the interactive computing environment that revolutionized data science. It lets you write and execute code in cells, see results immediately (including charts and tables), and mix code with Markdown text, equations, and images — all in a single shareable document (.ipynb file). With over 13,000 GitHub stars (and JupyterLab at 14K+), Jupyter has become the universal tool for data exploration, machine learning experimentation, teaching, and scientific research. The name "Jupyter" comes from Julia, Python, and R — the three original supported languages — though it now supports 40+ languages via kernels. ## What Jupyter Does Jupyter provides a web-based interface where you work in "notebooks" — documents containing an ordered list of cells. Each cell can be code (executed and showing output inline), Markdown (rendered as formatted text), or raw text. This creates a computational narrative where code, results, and explanations live together. ## Architecture Overview ``` [Browser UI] Notebook editor with cells | [Jupyter Server] Serves notebooks via HTTP Manages file system access | [Kernel Manager] Launches and manages language kernels | +-------+-------+-------+ | | | | [IPython] [IRkernel] [IJulia] Python R Julia kernel kernel kernel | [.ipynb File] JSON document with cells, outputs, metadata Version controlled, shareable ``` ## Self-Hosting & Configuration ```bash # Install with common data science packages pip install notebook numpy pandas matplotlib scikit-learn # Generate config file jupyter notebook --generate-config # jupyter_notebook_config.py — key settings # c.NotebookApp.ip = "0.0.0.0" # listen on all interfaces # c.NotebookApp.port = 8888 # default port # c.NotebookApp.open_browser = False # for remote servers # c.NotebookApp.password = "sha1:..." # password protection # Run with Docker # docker run -p 8888:8888 jupyter/scipy-notebook ``` ```python # Example notebook workflow (each block = a cell) # Cell 1: Import and load data import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv("data.csv") df.head() # Cell 2: Explore df.describe() # Cell 3: Visualize df.plot(kind="scatter", x="feature1", y="target", alpha=0.5) plt.title("Feature vs Target") plt.show() # Cell 4: Model from sklearn.linear_model import LinearRegression model = LinearRegression().fit(df[["feature1"]], df["target"]) print(f"R-squared: {model.score(df[['feature1']], df['target']):.3f}") ``` ## Key Features - **Interactive Cells** — execute code and see results inline immediately - **Rich Output** — display charts, tables, images, HTML, LaTeX equations - **40+ Languages** — Python, R, Julia, Scala, and more via kernels - **Markdown Cells** — mix documentation with code in the same document - **Magic Commands** — %timeit, %matplotlib, %%sql, and other shortcuts - **Widget System** — interactive sliders, dropdowns via ipywidgets - **Export** — convert to HTML, PDF, slides, Markdown, and Python scripts - **Collaboration** — share .ipynb files via GitHub, nbviewer, or Google Colab ## Comparison with Similar Tools | Feature | Jupyter Notebook | JupyterLab | Google Colab | VS Code Notebooks | Databricks | |---|---|---|---|---|---| | Interface | Classic | Modern IDE-like | Cloud | IDE integrated | Cloud | | Cost | Free | Free | Free (GPU) | Free | Paid | | Collaboration | Manual share | Manual share | Real-time | Live Share | Real-time | | GPU Access | Local only | Local only | Free T4 | Local only | Managed | | Extensions | Limited | Rich | Limited | Rich | Built-in | | File Explorer | Basic | Full | Drive | Full | Workspace | | Best For | Learning, Quick | Power Users | ML Training | Development | Enterprise | ## FAQ **Q: Jupyter Notebook vs JupyterLab — which should I use?** A: JupyterLab is the next-generation interface with tabs, file browser, terminal, and extensions. Use JupyterLab for daily work. Classic Notebook is simpler and still fine for basic tasks. Both use the same .ipynb format. **Q: How do I use Jupyter with virtual environments?** A: Install ipykernel in your virtual environment: "pip install ipykernel && python -m ipykernel install --user --name=myenv". Then select the kernel in Jupyter. **Q: Can I version control notebooks?** A: Yes, but .ipynb files are JSON with embedded outputs, making diffs noisy. Use tools like nbstripout to strip outputs before committing, or use jupytext to sync notebooks with plain Python scripts. **Q: How do I run Jupyter on a remote server?** A: Run "jupyter notebook --no-browser --port=8888" on the server, then SSH tunnel: "ssh -L 8888:localhost:8888 user@server". Access at localhost:8888 in your browser. ## Sources - GitHub: https://github.com/jupyter/notebook - Documentation: https://jupyter.org - JupyterLab: https://github.com/jupyterlab/jupyterlab - Created by Fernando Perez and Brian Granger - License: BSD 3-Clause --- Source: https://tokrepo.com/en/workflows/10a77bec-366d-11f1-9bc6-00163e2b0d79 Author: AI Open Source