DV Activity
DV Activity
Activity
Topic: Study of Python With Jupyter Notebook.
Introduction to
Python and Jupyter
Notebook
This course provides an introduction to Python programming, a
widely used language known for its readability, versatility, and
extensive libraries. We will focus on using Jupyter Notebook, an
interactive computing environment that combines code, text, and
visualizations, making it ideal for learning and exploring data analysis.
1
18-09-2024
1. Install Python and Jupyter 2. Launch Jupyter Notebook 3. Create a New Notebook
Download and install Python from Open a terminal or command Click "New" and choose "Python 3" to
the official website or use a prompt and type "jupyter notebook". create a new Jupyter Notebook file.
distribution like Anaconda. Install This will open Jupyter Notebook in You're ready to start coding!
Jupyter Notebook using the your web browser.
command "pip install jupyter".
2
18-09-2024
Code Cells
Code cells contain Python code that can be executed. Results are displayed below the cell. Use "Shift+Enter" to run a
cell.
Markdown Cells
Markdown cells are used for documentation, headings, lists, and formatting. Markdown is a simple markup
language for writing plain text with minimal syntax.
Cell Operations
You can add, delete, and move cells using the buttons above the notebook or keyboard shortcuts.
Input Output
10 + 5 15
3
18-09-2024
1 Exporting Notebooks
Export your notebook as an HTML, PDF, or other format. This allows you to
share your work with others who may not have Jupyter Notebook installed.
2 Cloud Platforms
Use online services like Google Colab or JupyterHub for collaborative editing
and sharing. These platforms allow multiple users to work on the same
notebook simultaneously.
3 Version Control
Use version control systems like Git to track changes and collaborate on
notebooks. This allows you to manage different versions of your work and
revert to previous states if needed.
4
18-09-2024
Example
Let's create a simple Jupyter Notebook with Python code that
calculates the average of a list of numbers. We'll use the built-in
`sum` and `len` functions to compute the average.
Code Output
numbers = [10, 20, 30, 40, 50] The average is: 30.0
average = sum(numbers) /
len(numbers) print("The
average is:", average)