SlideShare a Scribd company logo
Devashish Kumar
Faculty-IT
iNurture
Data Analysis
Data Analysis, also known as analysis of data or data analytics, is a
process of
 Inspecting,
 Cleansing,
 Transforming, and
 Modelling data with the goal of discovering useful information,
suggesting conclusions, and supporting decision-making.
Python as Data Science Tool?
Easy to learn
Scalability
Growing Data Analytics Libraries
Python community
Python Packages for Data Analysis
• Numpy and Scipy – fundamental scientific computing.
• Pandas – data manipulation and analysis.
• Matplotlib – plotting and visualization.
• Scikit-learn– machine learning and data mining.
• StatsModels – statistical modeling, testing, and analysis.
NumPY
The NumPy (Numeric Python) package required for high performance
computing and data analysis.
Low level library written in C (and FORTRAN) for high level
mathematical functions.
Overcomes the problem of running slower algorithms on Python by
using multidimensional arrays and functions that operate on arrays.
Allows concise and quick computations by VECTORIZATION.
To use NumPy module, we need to import it using:
Python in combination with NumPy,
Scipy and Matplotlib can be used as a
replacement for MATLAB.
Matplotlib module provides MATLAB-
like plotting functionality.
NumPy – A Replacement for MatLab
Operations Using NumPy
 Fast vectorized array operations for data munging and cleaning, subsetting and
filtering, transformation, and any other kinds of computations
 Common array algorithms like sorting, unique, and set operations
 Efficient descriptive statistics and aggregating/summarizing data
 Data alignment and relational data manipulations for merging and joining
together heterogeneous data sets
 Expressing conditional logic as array expressions instead of loops with if-elif-
else branches
 Group-wise data manipulations (aggregation, transformation, function
Core Python Vs NumPy
"Core Python", means Python without any special modules, i.e. especially without
NumPy.
Advantages of Core Python:
high-level number objects: integers, floating point
containers: lists with cheap insertion and append methods, dictionaries with fast
lookup
 Advantages of using NumPy with Python:
array oriented computing
efficiently implemented multi-dimensional arrays
Advantages of using NumPy with Python
 Array oriented computing
 Efficiently implemented multi-dimensional arrays
 Designed for scientific computation
 Standard mathematical functions for fast operations on entire arrays of data without
having to write loops
 Tools for reading / writing array data to disk and working with memory-mapped files
 Linear algebra, random number generation, and Fourier transform capabilities.
NumPy(Array)
 NumPy array is a grid of values.
 Similar to lists, except that every element of an array must be the same type.
 Alias for NumPy library is np.
 np.array() is used to convert a list into a NumPy array.
NumPy(Array)
SHAPE
Shape function gives a tuple of array dimensions and can be used to change the
dimensions of an array.
 Using shape to get array dimensions
 Using shape to change array dimensions
NumPy(Array)
RESHAPE
Gives a new shape to an array without changing its data.
Creates a new array and does not modify the original array itself.
NumPy(Array)
TRANSPOSE
Generates the transposition of an array using the function np.transpose.
Does not affect the original array, but it will create a new array.
NumPy(Array)
FLATTEN
Flatten creates a copy of the input array flattened to one dimension.
NumPy(Array)
 CONCATENATE
 Two or more arrays can be concatenated together using the concatenate function with a
tuple of the arrays to be joined:
 If an array has more than one dimension, it is possible to specify the axis along which
multiple arrays are concatenated. By default, it is along the first dimension.
NumPy(Array)
 ZEROS
The zeros tool returns a new array with a given shape and type filled with 0's.
 ONES
The ones tool returns a new array with a given shape and type filled with 1's.
NumPy(Array)
IDENTITY
Returns an identity array.
An identity array is a square matrix with all the main diagonal elements as 1 and the rest
as 0 . The default type of elements is float.
NumPy(Array)
EYE
 Returns a 2-D array with 1's as the diagonal and 0's elsewhere.
 The diagonal can be main, upper or lower depending on the optional parameter .
 Positive k is for the upper diagonal, a negative k is for the lower, and a 0k (default) is for the
main diagonal.
NumPy(Linear Algebra)
 The NumPy module also comes with a number of built-in routines for linear algebra
calculations.
 These can be found in the sub-module linalg.
 Some of the built in routines are:
 linalg.det
 linalg.eiv
 linalg.inv
NUMPY(LINEAR ALGEBRA)
 linalg.det: Computes the determinant of an array.
 linalg.eig: Computes the eigen values and right eigen vectors of a square array.
Operations On NumPy
We can perform operations on
numpy such as addition,
subtraction , multiplication and
even dot product of two or more
matrices
Operations On NumPy
 To transpose a matrix, use
matrix_name.T operation .
 To find what shape is of
transposed matrix is use
matrix_name.T.shape to find it.
TRANPOSE
Operations On NumPy
We can find the sum of matrices by
sum() operation.
We can find the maximum number in
the matrix by using max() operation.
We can find the position of the
element in the matrix where the
maximum or minimum value is in
place.
We can find the mean of a matrix
using mean() operation.
NumPy(Indexing/Slicing)
Fetches elements from 2nd to 7th
position of single dimensional array.
Fetches last 2 elements of single
dimensional array.
NumPy(Indexing/Slicing)
CONTRIBUTERS

More Related Content

What's hot

Introduction to numpy
Introduction to numpyIntroduction to numpy
Introduction to numpy
Gaurav Aggarwal
 
Python pandas Library
Python pandas LibraryPython pandas Library
Python pandas Library
Md. Sohag Miah
 
Matplotlib Review 2021
Matplotlib Review 2021Matplotlib Review 2021
Matplotlib Review 2021
Bhaskar J.Roy
 
NUMPY
NUMPY NUMPY
List in Python
List in PythonList in Python
List in Python
Siddique Ibrahim
 
Pandas
PandasPandas
Pandas
maikroeder
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
 
Python Scipy Numpy
Python Scipy NumpyPython Scipy Numpy
Python Scipy Numpy
Girish Khanzode
 
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
MahendraVusa
 
Introduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data AnalyticsIntroduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data Analytics
Phoenix
 
Data visualization in Python
Data visualization in PythonData visualization in Python
Data visualization in Python
Marc Garcia
 
Numpy tutorial
Numpy tutorialNumpy tutorial
Numpy tutorial
HarikaReddy115
 
Python libraries
Python librariesPython libraries
Python libraries
Prof. Dr. K. Adisesha
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
Andrew Henshaw
 
Introduction to numpy Session 1
Introduction to numpy Session 1Introduction to numpy Session 1
Introduction to numpy Session 1
Jatin Miglani
 
Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
RaginiJain21
 
Python programming
Python  programmingPython  programming
Python programming
Ashwin Kumar Ramasamy
 
Python Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptxPython Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptx
ShreyasLawand
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
 

What's hot (20)

Introduction to numpy
Introduction to numpyIntroduction to numpy
Introduction to numpy
 
Python pandas Library
Python pandas LibraryPython pandas Library
Python pandas Library
 
Matplotlib Review 2021
Matplotlib Review 2021Matplotlib Review 2021
Matplotlib Review 2021
 
NUMPY
NUMPY NUMPY
NUMPY
 
List in Python
List in PythonList in Python
List in Python
 
Pandas
PandasPandas
Pandas
 
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
 
Python Scipy Numpy
Python Scipy NumpyPython Scipy Numpy
Python Scipy Numpy
 
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
 
Introduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data AnalyticsIntroduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data Analytics
 
Data visualization in Python
Data visualization in PythonData visualization in Python
Data visualization in Python
 
Numpy tutorial
Numpy tutorialNumpy tutorial
Numpy tutorial
 
Python libraries
Python librariesPython libraries
Python libraries
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
 
Introduction to numpy Session 1
Introduction to numpy Session 1Introduction to numpy Session 1
Introduction to numpy Session 1
 
Pandas
PandasPandas
Pandas
 
Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
 
Python programming
Python  programmingPython  programming
Python programming
 
Python Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptxPython Data Structures and Algorithms.pptx
Python Data Structures and Algorithms.pptx
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 

Similar to Data Analysis in Python-NumPy

CAP776Numpy (2).ppt
CAP776Numpy (2).pptCAP776Numpy (2).ppt
CAP776Numpy (2).ppt
ChhaviCoachingCenter
 
CAP776Numpy.ppt
CAP776Numpy.pptCAP776Numpy.ppt
CAP776Numpy.ppt
kdr52121
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
EN1036VivekSingh
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptx
Kirti Verma
 
Python
PythonPython
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
Polad Saruxanov
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
DrJasmineBeulahG
 
Numpy
NumpyNumpy
Scientific Python
Scientific PythonScientific Python
Scientific Python
Eueung Mulyana
 
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptxChapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
SovannDoeur
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
Govardhan Bhavani
 
Week 11.pptx
Week 11.pptxWeek 11.pptx
Week 11.pptx
CruiseCH
 
getting started with numpy and pandas.pptx
getting started with numpy and pandas.pptxgetting started with numpy and pandas.pptx
getting started with numpy and pandas.pptx
workvishalkumarmahat
 
Data Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptxData Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptx
PoojaChavan51
 
Arrays with Numpy, Computer Graphics
Arrays with Numpy, Computer GraphicsArrays with Numpy, Computer Graphics
Arrays with Numpy, Computer Graphics
Prabu U
 
Standardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft PresentationStandardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft Presentation
Travis Oliphant
 
Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
ssuser0e701a
 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - Revision
Ahmed Gad
 
Python for ML.pptx
Python for ML.pptxPython for ML.pptx
Python for ML.pptx
Dr. Amanpreet Kaur
 

Similar to Data Analysis in Python-NumPy (20)

CAP776Numpy (2).ppt
CAP776Numpy (2).pptCAP776Numpy (2).ppt
CAP776Numpy (2).ppt
 
CAP776Numpy.ppt
CAP776Numpy.pptCAP776Numpy.ppt
CAP776Numpy.ppt
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptx
 
Python
PythonPython
Python
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Numpy
NumpyNumpy
Numpy
 
Scientific Python
Scientific PythonScientific Python
Scientific Python
 
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptxChapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Week 11.pptx
Week 11.pptxWeek 11.pptx
Week 11.pptx
 
getting started with numpy and pandas.pptx
getting started with numpy and pandas.pptxgetting started with numpy and pandas.pptx
getting started with numpy and pandas.pptx
 
Data Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptxData Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptx
 
Arrays with Numpy, Computer Graphics
Arrays with Numpy, Computer GraphicsArrays with Numpy, Computer Graphics
Arrays with Numpy, Computer Graphics
 
Standardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft PresentationStandardizing arrays -- Microsoft Presentation
Standardizing arrays -- Microsoft Presentation
 
Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
 
Python for Computer Vision - Revision
Python for Computer Vision - RevisionPython for Computer Vision - Revision
Python for Computer Vision - Revision
 
Python for ML.pptx
Python for ML.pptxPython for ML.pptx
Python for ML.pptx
 

More from Devashish Kumar

Python: Data Visualisation
Python: Data  VisualisationPython: Data  Visualisation
Python: Data Visualisation
Devashish Kumar
 
Pandas csv
Pandas csvPandas csv
Pandas csv
Devashish Kumar
 
Data Analysis packages
Data Analysis packagesData Analysis packages
Data Analysis packages
Devashish Kumar
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1
Devashish Kumar
 
Cloud Computing Introductory-1
Cloud Computing Introductory-1Cloud Computing Introductory-1
Cloud Computing Introductory-1
Devashish Kumar
 

More from Devashish Kumar (6)

Python: Data Visualisation
Python: Data  VisualisationPython: Data  Visualisation
Python: Data Visualisation
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
Data Analysis packages
Data Analysis packagesData Analysis packages
Data Analysis packages
 
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1
 
Cloud Computing Introductory-1
Cloud Computing Introductory-1Cloud Computing Introductory-1
Cloud Computing Introductory-1
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
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 geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
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
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
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
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes 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 geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
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
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
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
 

Data Analysis in Python-NumPy

  • 2. Data Analysis Data Analysis, also known as analysis of data or data analytics, is a process of  Inspecting,  Cleansing,  Transforming, and  Modelling data with the goal of discovering useful information, suggesting conclusions, and supporting decision-making.
  • 3. Python as Data Science Tool? Easy to learn Scalability Growing Data Analytics Libraries Python community
  • 4. Python Packages for Data Analysis • Numpy and Scipy – fundamental scientific computing. • Pandas – data manipulation and analysis. • Matplotlib – plotting and visualization. • Scikit-learn– machine learning and data mining. • StatsModels – statistical modeling, testing, and analysis.
  • 5. NumPY The NumPy (Numeric Python) package required for high performance computing and data analysis. Low level library written in C (and FORTRAN) for high level mathematical functions. Overcomes the problem of running slower algorithms on Python by using multidimensional arrays and functions that operate on arrays. Allows concise and quick computations by VECTORIZATION. To use NumPy module, we need to import it using:
  • 6. Python in combination with NumPy, Scipy and Matplotlib can be used as a replacement for MATLAB. Matplotlib module provides MATLAB- like plotting functionality. NumPy – A Replacement for MatLab
  • 7. Operations Using NumPy  Fast vectorized array operations for data munging and cleaning, subsetting and filtering, transformation, and any other kinds of computations  Common array algorithms like sorting, unique, and set operations  Efficient descriptive statistics and aggregating/summarizing data  Data alignment and relational data manipulations for merging and joining together heterogeneous data sets  Expressing conditional logic as array expressions instead of loops with if-elif- else branches  Group-wise data manipulations (aggregation, transformation, function
  • 8. Core Python Vs NumPy "Core Python", means Python without any special modules, i.e. especially without NumPy. Advantages of Core Python: high-level number objects: integers, floating point containers: lists with cheap insertion and append methods, dictionaries with fast lookup  Advantages of using NumPy with Python: array oriented computing efficiently implemented multi-dimensional arrays
  • 9. Advantages of using NumPy with Python  Array oriented computing  Efficiently implemented multi-dimensional arrays  Designed for scientific computation  Standard mathematical functions for fast operations on entire arrays of data without having to write loops  Tools for reading / writing array data to disk and working with memory-mapped files  Linear algebra, random number generation, and Fourier transform capabilities.
  • 10. NumPy(Array)  NumPy array is a grid of values.  Similar to lists, except that every element of an array must be the same type.  Alias for NumPy library is np.  np.array() is used to convert a list into a NumPy array.
  • 11. NumPy(Array) SHAPE Shape function gives a tuple of array dimensions and can be used to change the dimensions of an array.  Using shape to get array dimensions  Using shape to change array dimensions
  • 12. NumPy(Array) RESHAPE Gives a new shape to an array without changing its data. Creates a new array and does not modify the original array itself.
  • 13. NumPy(Array) TRANSPOSE Generates the transposition of an array using the function np.transpose. Does not affect the original array, but it will create a new array.
  • 14. NumPy(Array) FLATTEN Flatten creates a copy of the input array flattened to one dimension.
  • 15. NumPy(Array)  CONCATENATE  Two or more arrays can be concatenated together using the concatenate function with a tuple of the arrays to be joined:  If an array has more than one dimension, it is possible to specify the axis along which multiple arrays are concatenated. By default, it is along the first dimension.
  • 16. NumPy(Array)  ZEROS The zeros tool returns a new array with a given shape and type filled with 0's.  ONES The ones tool returns a new array with a given shape and type filled with 1's.
  • 17. NumPy(Array) IDENTITY Returns an identity array. An identity array is a square matrix with all the main diagonal elements as 1 and the rest as 0 . The default type of elements is float.
  • 18. NumPy(Array) EYE  Returns a 2-D array with 1's as the diagonal and 0's elsewhere.  The diagonal can be main, upper or lower depending on the optional parameter .  Positive k is for the upper diagonal, a negative k is for the lower, and a 0k (default) is for the main diagonal.
  • 19. NumPy(Linear Algebra)  The NumPy module also comes with a number of built-in routines for linear algebra calculations.  These can be found in the sub-module linalg.  Some of the built in routines are:  linalg.det  linalg.eiv  linalg.inv
  • 20. NUMPY(LINEAR ALGEBRA)  linalg.det: Computes the determinant of an array.  linalg.eig: Computes the eigen values and right eigen vectors of a square array.
  • 21. Operations On NumPy We can perform operations on numpy such as addition, subtraction , multiplication and even dot product of two or more matrices
  • 22. Operations On NumPy  To transpose a matrix, use matrix_name.T operation .  To find what shape is of transposed matrix is use matrix_name.T.shape to find it. TRANPOSE
  • 23. Operations On NumPy We can find the sum of matrices by sum() operation. We can find the maximum number in the matrix by using max() operation. We can find the position of the element in the matrix where the maximum or minimum value is in place. We can find the mean of a matrix using mean() operation.
  • 24. NumPy(Indexing/Slicing) Fetches elements from 2nd to 7th position of single dimensional array. Fetches last 2 elements of single dimensional array.