[go: up one dir, main page]

0% found this document useful (0 votes)
19 views5 pages

DV Activity

This document provides an introduction to Python programming and Jupyter Notebook, focusing on installation, basic syntax, and data structures. It covers features of Jupyter Notebook, including code and markdown cells, as well as data visualization techniques using libraries like Matplotlib and Seaborn. Additionally, it discusses collaboration and sharing options for notebooks, including exporting and using cloud platforms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

DV Activity

This document provides an introduction to Python programming and Jupyter Notebook, focusing on installation, basic syntax, and data structures. It covers features of Jupyter Notebook, including code and markdown cells, as well as data visualization techniques using libraries like Matplotlib and Seaborn. Additionally, it discusses collaboration and sharing options for notebooks, including exporting and using cloud platforms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

18-09-2024

Kavikulguru Institute of Technology and Science,


Ramtek-441106

Activity
Topic: Study of Python With Jupyter Notebook.

Name: Suraj Bhute


Roll No: CT21042
Guided by:-
Section: B
Mr. Sarang Gurve
Subject: Data Visualization

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

Setting up the Jupyter Notebook Environment


Begin by installing Python and Jupyter Notebook on your computer. Numerous resources like Anaconda offer a
convenient bundle with Python and Jupyter Notebook, along with other scientific computing libraries. Once installed,
launch Jupyter Notebook, which will open a web-based interface where you can create, edit, and run notebooks.

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".

Basic Python Syntax and Data


Structures
Python's syntax is designed to be clear and readable, relying on indentation for code
structure. We will explore basic concepts like variables, operators, data types, and
control flow, using simple examples to understand how these elements work
together. Key data structures include lists, tuples, dictionaries, and sets, providing
efficient ways to organize and manipulate data.

1 Variables 2 Data Types


Variables store data. Use an equal Python handles different types of
sign (=) to assign values to data like integers, floating-point
variables. Example: my_variable = numbers, strings, and booleans.
10.

3 Operators 4 Control Flow


Operators perform operations on Control flow statements like if-else
data. Common operators include and loops (for, while) dictate the
arithmetic (+, -, *, /) and order of code execution.
comparison (==, !=, <, >).

2
18-09-2024

Exploring Jupyter Notebook Features


Jupyter Notebook offers a rich set of features for interactive programming and documentation. Cells are the building blocks of a
notebook, allowing you to write and execute code or create markdown text with headings, paragraphs, and formatting. Cells can
be easily rearranged, duplicated, and deleted, making it easy to organize your work.

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.

Executing Python Code in


Jupyter Notebook
To execute Python code in Jupyter Notebook, create a code cell and
enter your Python code. You can run a cell by pressing "Shift+Enter" or
clicking the "Run" button. The output of your code will be displayed
below the cell, allowing you to see results in real time.

Input Output

print("Hello, world!") Hello, world!

10 + 5 15

3
18-09-2024

Visualizing Data with Jupyter


Notebook
Jupyter Notebook excels at visualizing data. Libraries like Matplotlib, Seaborn, and Plotly
offer a wide range of plotting options. You can create various chart types like bar charts,
line charts, scatter plots, histograms, and more. Visualizations make it easy to
understand patterns, trends, and relationships in your data.

Bar Charts Line Charts


Ideal for comparing categorical data or Excellent for visualizing trends over time
showing the distribution of discrete or displaying continuous data.
values.

Scatter Plots Pie Charts


Show the relationship between two Useful for representing parts of a whole,
variables, revealing correlations and showing proportions and percentages.
patterns.

Collaborating and Sharing Notebooks


Jupyter Notebook supports collaboration and sharing. You can easily share your notebooks
with colleagues or students, enabling them to view, modify, and run your code. Sharing can
be done through various methods, such as exporting notebooks to different formats (HTML,
PDF) or using cloud platforms for collaborative editing.

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)

You might also like