SlideShare a Scribd company logo
Python for Data Science
(Introduction to Data Visualization)
Dr.M.Rajendiran
Dept. of Computer Science and Engineering
Panimalar Engineering College
Install Python 3 On Ubuntu
Prerequisites
Step 1.A system running Ubuntu
Step 2.A user account with sudo privileges
Step 3.Access to a terminal command-line (Ctrl–Alt–T)
Step 4.Make sure your environment is configured to use
Python 3.8
2
Install Python 3
Now you can start the installation of Python 3.8.
$sudo apt install python3.8
Allow the process to complete and verify the Python
version was installed successfully
$python ––version
3
Installing and using Python on Windows is very simple.
Step 1: Download the Python Installer binaries
Step 2: Run the Executable Installer
Step 3: Add Python to environmental variables
Step 4: Verify the Python Installation
4
Python Installation
Open the Python website in your web browser.
https://www.python.org/downloads/windows/
Once the installer is downloaded, run the Python installer.
Add the following path
C:Program FilesPython37-32: for 64-bit installation
Once the installation is over, you will see a Python Setup
Successful window.
You are ready to start developing Python applications in
your Windows 10 system.
5
iPython Installation
If you already have Python installed, you can use pip to
install iPython using the following command:
$pip install iPython
To use it, type the following command in your computer’s
terminal:
$ipython
6
Data Visualization
 A picture is worth a million words.
 Data visualization plays an essential role in the representation of
both small and large data.
 Data visualization is the graphical representation of data in order to
interactively and efficiently understanding to clients and customers.
 Data visualization enable us to extract information, better
understand the data, and make more effective decisions.
 One of the key role of data scientist is the ability to tell a compelling
story, visualizing data and findings in an approachable and
motivating way.
Data Visualization
 With a tiny domain knowledge, data visualizations can be used to
express and demonstrate key relationships in plots and charts.
There are five key basic data visualization.
1. Line Plot
2. Bar Chart
3. Histogram Plot
4. Box and Whisker Plot
5. Scatter Plot
Data Visualization
Matplotlib
 Matplotlib is one of the most popular python library packages used
for data visualization.
 It is numerical mathematics extension NumPy.
 It provides an object-oriented programming for embedding plots into
applications.
 It uses general-purpose graphic tools like Tkinter, wxpython, etc.,
 It can be used in Python and IPython, Jupyterlab and
Jupyternotebook.
Data Visualization
 We will learn how to create a line plot with matplotlib.
 The following example creates a sequence of floating point values
as the x-axis and a sine wave as a function of the x-axis as the
observations on the y-axis.
 The outputs are plotted as a line plot.
 The pyplot module from matplotlib package is imported with an alias
pyplot.
from matplotlib import pyplot
 We need an array of numbers to plot. NumPy library which is
imported with the sin alias.
from numpy import sin
Data Visualization
 The drawings of line plot can be shown by calling the show()
function.
pyplot.show()
 The line plot can be saved to file using savefig() function.
pyplot.savefig('my_image.png')
 Line plots are useful for presenting time series data as well as any
order data.
 A line plot is used to present observations collected at consistent
intervals.
 A line plot can be created by calling the plot() function.
 The complete program is as follows:
Data Visualization
 *
Data Visualization
Bar chart
 A bar chart or graph that presents categorical data with rectangular
bars with heights proportional to the values.
 The bars can be plotted vertically or horizontally.
 A bar graph shows comparisons among distinct categories.
 One axis represent categories and other axis represent value.
 Matplotlib provides the bar() function that can be used in the python.
Syntax: bar(x, height, width, bottom, align)
x: sequence of scalar
height: The height of the bars
width: The width of the bars
bottom: The coordinates of the bars bases.
align: Alignment of the bars to the x coordinates.
Data Visualization
Data Visualization
Histograms
 A histogram is a graphical illustration that organizes a group of data
points into user-specified ranges.
 In a histogram, it is the area of the bar that shows the frequency of
occurrences for each bin.
 A Histogram has two axes that is x axis and y axis.
 The x axis represent event whose frequency you have to count.
 The y axis represent frequency.
 The different heights of bar show different frequency of occurrence
of data.
 Histograms uses in image processing, brightness, equalize an
image and computer vision.
Data Visualization
A histogram plot can be created by calling the hist() function and
passing in a list or array.
pyplot.hist(x)
The following parameters for a histogram:
x : array or sequence of arrays
bins : integer or sequence or optional
Example:
Consider a semester examination result that we have to make a
histogram graph of your results, showing the overall frequency of
occurrence of grade in class.
marks=(45,54,65,56,74,47,87,78,98,89,100,72,58,28,44,49,71,80)
Data Visualization
Data Visualization
Box and Whisker Plot
A boxplot is generally used to summarize the distribution of a data
sample, also called box and whisker plot
A set of data containing the minimum, first quartile, median, third
quartile, and maximum.
In a box plot, we draw a box from the first quartile to the third
quartile.
Vertical line goes through the box at the median.
The whiskers go from each quartile to the minimum or maximum.
The x-axis is used to represent the data sample and y-axis
represents the observation values.
Data Visualization
Example:
We use the numpy.random.normal() function to create the
data for boxplots.
It has three parameters such as mean and standard deviation
and number of values.
Boxplots can be drawn by calling the boxplot() function.
pyplot.boxplot(x)
Data Visualization
Data Visualization
Scatter Plot
 A scatterplot is a graphic tool used to display the relationship
between two quantitative variables.
 A scatterplot consists of an X axis, a Y axis and a series of dots.
 Scatter plots can be created by calling the scatter() function.
pyplot.scatter(x, y)
Scatter plots are useful for showing the association between two
variables.
The example below creates two data samples such as marks of
boys and girls in two different colours.
Data Visualization
Conclusion
 Python is great as a programming language
 It is great for data science.
There are many visualization libraries:
Matplotlib
seaborn
bokesh
holoviews
datashader
folium
yt
 email:mrajen@rediffmail.com
.

More Related Content

What's hot

GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
Muthu Vinayagam
 
Dev Concepts: Data Structures and Algorithms
Dev Concepts: Data Structures and AlgorithmsDev Concepts: Data Structures and Algorithms
Dev Concepts: Data Structures and Algorithms
Svetlin Nakov
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues
Intro C# Book
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
Hock Leng PUAH
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
Shubham Sharma
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Python iteration
Python iterationPython iteration
Python iterationdietbuddha
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loops
James Brotsos
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programming
nmahi96
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
tanmaymodi4
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and Variables
Intro C# Book
 
Arrays-Computer programming
Arrays-Computer programmingArrays-Computer programming
Arrays-Computer programming
nmahi96
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
Arockia Abins
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
Computer notes - Expression Tree
Computer notes - Expression TreeComputer notes - Expression Tree
Computer notes - Expression Tree
ecomputernotes
 
Binary expression tree
Binary expression treeBinary expression tree
Binary expression tree
Shab Bi
 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQ
Intro C# Book
 

What's hot (19)

GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
Dev Concepts: Data Structures and Algorithms
Dev Concepts: Data Structures and AlgorithmsDev Concepts: Data Structures and Algorithms
Dev Concepts: Data Structures and Algorithms
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
Python iteration
Python iterationPython iteration
Python iteration
 
Ch02 primitive-data-definite-loops
Ch02 primitive-data-definite-loopsCh02 primitive-data-definite-loops
Ch02 primitive-data-definite-loops
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programming
 
Arrays in c language
Arrays in c languageArrays in c language
Arrays in c language
 
02. Primitive Data Types and Variables
02. Primitive Data Types and Variables02. Primitive Data Types and Variables
02. Primitive Data Types and Variables
 
Arrays-Computer programming
Arrays-Computer programmingArrays-Computer programming
Arrays-Computer programming
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
 
Arrays C#
Arrays C#Arrays C#
Arrays C#
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Computer notes - Expression Tree
Computer notes - Expression TreeComputer notes - Expression Tree
Computer notes - Expression Tree
 
Binary expression tree
Binary expression treeBinary expression tree
Binary expression tree
 
Chapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQChapter 22. Lambda Expressions and LINQ
Chapter 22. Lambda Expressions and LINQ
 

Similar to Python for Data Science

12-IP.pdf
12-IP.pdf12-IP.pdf
12-IP.pdf
kajalkhorwal106
 
20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf
MariaKhan905189
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
 
Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
yazad dumasia
 
Lecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptxLecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptx
jovannyflex
 
Lecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptxLecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptx
jovannyflex
 
Visualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptxVisualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptx
SharmilaMore5
 
The Role of Histograms in Exploring Data Insights
The Role of Histograms in Exploring Data InsightsThe Role of Histograms in Exploring Data Insights
The Role of Histograms in Exploring Data Insights
CIToolkit
 
Data visualization using py plot part i
Data visualization using py plot part iData visualization using py plot part i
Data visualization using py plot part i
TutorialAICSIP
 
Python for data analysis
Python for data analysisPython for data analysis
Python for data analysis
Savitribai Phule Pune University
 
Graph Tea: Simulating Tool for Graph Theory & Algorithms
Graph Tea: Simulating Tool for Graph Theory & AlgorithmsGraph Tea: Simulating Tool for Graph Theory & Algorithms
Graph Tea: Simulating Tool for Graph Theory & Algorithms
IJMTST Journal
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
Sandeep Singh
 
Python for Data Analysis.pdf
Python for Data Analysis.pdfPython for Data Analysis.pdf
Python for Data Analysis.pdf
JulioRecaldeLara1
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
tangadhurai
 
Objects and Graphics
Objects and GraphicsObjects and Graphics
Objects and Graphics
Edwin Flórez Gómez
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
Golden Julie Jesus
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using Python
NishantKumar1179
 
Python basics
Python basicsPython basics
Python basics
Manisha Gholve
 
Project
ProjectProject

Similar to Python for Data Science (20)

12-IP.pdf
12-IP.pdf12-IP.pdf
12-IP.pdf
 
20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf20MEMECH Part 3- Classification.pdf
20MEMECH Part 3- Classification.pdf
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
 
Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
 
Lecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptxLecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptx
 
Lecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptxLecture 5 – Computing with Numbers (Math Lib).pptx
Lecture 5 – Computing with Numbers (Math Lib).pptx
 
Visualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptxVisualization and Matplotlib using Python.pptx
Visualization and Matplotlib using Python.pptx
 
The Role of Histograms in Exploring Data Insights
The Role of Histograms in Exploring Data InsightsThe Role of Histograms in Exploring Data Insights
The Role of Histograms in Exploring Data Insights
 
Data visualization using py plot part i
Data visualization using py plot part iData visualization using py plot part i
Data visualization using py plot part i
 
Python for data analysis
Python for data analysisPython for data analysis
Python for data analysis
 
Graph Tea: Simulating Tool for Graph Theory & Algorithms
Graph Tea: Simulating Tool for Graph Theory & AlgorithmsGraph Tea: Simulating Tool for Graph Theory & Algorithms
Graph Tea: Simulating Tool for Graph Theory & Algorithms
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
 
Python for Data Analysis.pdf
Python for Data Analysis.pdfPython for Data Analysis.pdf
Python for Data Analysis.pdf
 
Python-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptxPython-for-Data-Analysis.pptx
Python-for-Data-Analysis.pptx
 
Chapter04.pptx
Chapter04.pptxChapter04.pptx
Chapter04.pptx
 
Objects and Graphics
Objects and GraphicsObjects and Graphics
Objects and Graphics
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using Python
 
Python basics
Python basicsPython basics
Python basics
 
Project
ProjectProject
Project
 

More from Panimalar Engineering College

Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
Panimalar Engineering College
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
Panimalar Engineering College
 
Cellular Networks
Cellular NetworksCellular Networks
Wireless Networks
Wireless NetworksWireless Networks
Wireless Networks
Wireless NetworksWireless Networks
Multiplexing,LAN Cabling,Routers,Core and Distribution Networks
Multiplexing,LAN Cabling,Routers,Core and Distribution NetworksMultiplexing,LAN Cabling,Routers,Core and Distribution Networks
Multiplexing,LAN Cabling,Routers,Core and Distribution Networks
Panimalar Engineering College
 

More from Panimalar Engineering College (6)

Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Cellular Networks
Cellular NetworksCellular Networks
Cellular Networks
 
Wireless Networks
Wireless NetworksWireless Networks
Wireless Networks
 
Wireless Networks
Wireless NetworksWireless Networks
Wireless Networks
 
Multiplexing,LAN Cabling,Routers,Core and Distribution Networks
Multiplexing,LAN Cabling,Routers,Core and Distribution NetworksMultiplexing,LAN Cabling,Routers,Core and Distribution Networks
Multiplexing,LAN Cabling,Routers,Core and Distribution Networks
 

Recently uploaded

Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 

Recently uploaded (20)

Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 

Python for Data Science

  • 1. Python for Data Science (Introduction to Data Visualization) Dr.M.Rajendiran Dept. of Computer Science and Engineering Panimalar Engineering College
  • 2. Install Python 3 On Ubuntu Prerequisites Step 1.A system running Ubuntu Step 2.A user account with sudo privileges Step 3.Access to a terminal command-line (Ctrl–Alt–T) Step 4.Make sure your environment is configured to use Python 3.8 2
  • 3. Install Python 3 Now you can start the installation of Python 3.8. $sudo apt install python3.8 Allow the process to complete and verify the Python version was installed successfully $python ––version 3
  • 4. Installing and using Python on Windows is very simple. Step 1: Download the Python Installer binaries Step 2: Run the Executable Installer Step 3: Add Python to environmental variables Step 4: Verify the Python Installation 4
  • 5. Python Installation Open the Python website in your web browser. https://www.python.org/downloads/windows/ Once the installer is downloaded, run the Python installer. Add the following path C:Program FilesPython37-32: for 64-bit installation Once the installation is over, you will see a Python Setup Successful window. You are ready to start developing Python applications in your Windows 10 system. 5
  • 6. iPython Installation If you already have Python installed, you can use pip to install iPython using the following command: $pip install iPython To use it, type the following command in your computer’s terminal: $ipython 6
  • 7. Data Visualization  A picture is worth a million words.  Data visualization plays an essential role in the representation of both small and large data.  Data visualization is the graphical representation of data in order to interactively and efficiently understanding to clients and customers.  Data visualization enable us to extract information, better understand the data, and make more effective decisions.  One of the key role of data scientist is the ability to tell a compelling story, visualizing data and findings in an approachable and motivating way.
  • 8. Data Visualization  With a tiny domain knowledge, data visualizations can be used to express and demonstrate key relationships in plots and charts. There are five key basic data visualization. 1. Line Plot 2. Bar Chart 3. Histogram Plot 4. Box and Whisker Plot 5. Scatter Plot
  • 9. Data Visualization Matplotlib  Matplotlib is one of the most popular python library packages used for data visualization.  It is numerical mathematics extension NumPy.  It provides an object-oriented programming for embedding plots into applications.  It uses general-purpose graphic tools like Tkinter, wxpython, etc.,  It can be used in Python and IPython, Jupyterlab and Jupyternotebook.
  • 10. Data Visualization  We will learn how to create a line plot with matplotlib.  The following example creates a sequence of floating point values as the x-axis and a sine wave as a function of the x-axis as the observations on the y-axis.  The outputs are plotted as a line plot.  The pyplot module from matplotlib package is imported with an alias pyplot. from matplotlib import pyplot  We need an array of numbers to plot. NumPy library which is imported with the sin alias. from numpy import sin
  • 11. Data Visualization  The drawings of line plot can be shown by calling the show() function. pyplot.show()  The line plot can be saved to file using savefig() function. pyplot.savefig('my_image.png')  Line plots are useful for presenting time series data as well as any order data.  A line plot is used to present observations collected at consistent intervals.  A line plot can be created by calling the plot() function.  The complete program is as follows:
  • 13. Data Visualization Bar chart  A bar chart or graph that presents categorical data with rectangular bars with heights proportional to the values.  The bars can be plotted vertically or horizontally.  A bar graph shows comparisons among distinct categories.  One axis represent categories and other axis represent value.  Matplotlib provides the bar() function that can be used in the python. Syntax: bar(x, height, width, bottom, align) x: sequence of scalar height: The height of the bars width: The width of the bars bottom: The coordinates of the bars bases. align: Alignment of the bars to the x coordinates.
  • 15. Data Visualization Histograms  A histogram is a graphical illustration that organizes a group of data points into user-specified ranges.  In a histogram, it is the area of the bar that shows the frequency of occurrences for each bin.  A Histogram has two axes that is x axis and y axis.  The x axis represent event whose frequency you have to count.  The y axis represent frequency.  The different heights of bar show different frequency of occurrence of data.  Histograms uses in image processing, brightness, equalize an image and computer vision.
  • 16. Data Visualization A histogram plot can be created by calling the hist() function and passing in a list or array. pyplot.hist(x) The following parameters for a histogram: x : array or sequence of arrays bins : integer or sequence or optional Example: Consider a semester examination result that we have to make a histogram graph of your results, showing the overall frequency of occurrence of grade in class. marks=(45,54,65,56,74,47,87,78,98,89,100,72,58,28,44,49,71,80)
  • 18. Data Visualization Box and Whisker Plot A boxplot is generally used to summarize the distribution of a data sample, also called box and whisker plot A set of data containing the minimum, first quartile, median, third quartile, and maximum. In a box plot, we draw a box from the first quartile to the third quartile. Vertical line goes through the box at the median. The whiskers go from each quartile to the minimum or maximum. The x-axis is used to represent the data sample and y-axis represents the observation values.
  • 19. Data Visualization Example: We use the numpy.random.normal() function to create the data for boxplots. It has three parameters such as mean and standard deviation and number of values. Boxplots can be drawn by calling the boxplot() function. pyplot.boxplot(x)
  • 21. Data Visualization Scatter Plot  A scatterplot is a graphic tool used to display the relationship between two quantitative variables.  A scatterplot consists of an X axis, a Y axis and a series of dots.  Scatter plots can be created by calling the scatter() function. pyplot.scatter(x, y) Scatter plots are useful for showing the association between two variables. The example below creates two data samples such as marks of boys and girls in two different colours.
  • 23. Conclusion  Python is great as a programming language  It is great for data science. There are many visualization libraries: Matplotlib seaborn bokesh holoviews datashader folium yt  email:mrajen@rediffmail.com
  • 24. .