Introduction to Jupyter Notebooks#

This notebook provides an introduction to Jupyter notebooks, a powerful tool for interactive computing and data analysis in Python.

What is a Jupyter Notebook?#

A Jupyter notebook is an interactive document that combines live code, equations, visualizations, and narrative text. It’s widely used in data science, scientific computing, and education.

Let’s start by printing a simple message to demonstrate how code cells work in Jupyter notebooks.

print("Welcome to Jupyter notebooks!")
Welcome to Jupyter notebooks!

Basic Python Operations#

Jupyter notebooks allow you to execute Python code interactively. Let’s perform a simple calculation.

result = 5 + 3
print(f"5 + 3 = {result}")
5 + 3 = 8

Variables and Data Types#

We can define variables and work with different data types in Jupyter notebooks. Let’s create a string variable.

greeting = "Hello, Jupyter!"
print(greeting)
Hello, Jupyter!

Markdown Cells#

Jupyter notebooks support Markdown for rich text formatting. This cell is an example of a Markdown cell.

You can use Markdown to create:

  • Lists

  • Bold text

  • Italic text

  • Links

Importing Libraries#

Jupyter notebooks allow you to import and use Python libraries. Let’s import a common library, NumPy.

import numpy as np
print("NumPy version:", np.__version__)
NumPy version: 1.24.4

Creating Arrays#

Now that we’ve imported NumPy, let’s create a simple array to demonstrate its functionality.

arr = np.array([1, 2, 3, 4, 5])
print("NumPy array:", arr)
NumPy array: [1 2 3 4 5]

Conclusion#

This notebook has introduced you to the basics of Jupyter notebooks, including code execution, Markdown formatting, and library importing. Jupyter notebooks are a powerful tool for interactive computing and data analysis in Python.