SlideShare a Scribd company logo
4
Most read
5
Most read
12
Most read
Name : Abhijeet Anand
Dept : A.I&D.S
Roll No. : 20AD001
Reg no : 201201001
Date : 07-09-2021
Topic : NumPy
Numpy
PRESENTED
BY
- Abhijeet Anand
(A.I & D.S)
PYTHON
By : A.A.Raj
What is NumPy ?
NumPy Stands For Numerical Python.
NumPy is a Python library used for working with
array
NumPy is the fundamental package for scientific
computing in Python.
It also has functions for working in domain of
linear algebra, Fourier transform, and matrices.
NumPy was created in 2005 by Travis Oliphant.
It is an open source project and you can use it
freely.
Why Use NumPy ?
In Python we have lists that serve the purpose of
arrays, but they are slow to process.
NumPy aims to provide an array object that is up to
50x faster than traditional Python lists.
The Array object in NumPy is called ndarray, it
provides a lot of supporting functions that make
working with ndarray very easy.
Arrays are very frequently used in data science,
where speed and resources are very important.
Why is NumPy Faster Than Lists?
NumPy arrays are stored at one continuous place
in memory unlike lists, so processes can access
and manipulate them very efficiently.
This behavior is called locality of reference in
computer science.
This is the main reason why NumPy is faster than
lists. Also it is optimized to work with latest CPU
architectures.
Arrays in NumPy
An Array is a collection of values, organized in a specific order.
NumPy’s main object is the homogeneous
multidimensional array.
It is a table of elements (usually numbers), all of the same
type, indexed by a tuple of positive integers.
In NumPy dimensions are called axis. The number of axis
is rank.
NumPy’s array class is called ndarray. It is also known by
the alias array.
NumPy
1-D Array
An array that has 0-D arrays as its elements is
called uni-dimensional or 1-D array . These are
the most common and basic arrays
Import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
2-D Array
An array that has 1-D arrays as its elements is called a 2-
D array.These are often used to represent matrix or 2nd
order tensors.
Import numpy as np
arr = np.array([[1, 2, 3], [4, 5,6]])
print(arr)
3-D Arrays
An array that has 2-D arrays (matrices) as its
elements is called 3-D array.These are often used to
represent a 3rd order tensor.
Import numpy as np
arr = np.array([[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]])
print(arr)
np.array([1,2,3]) 1d array
np.array([(1,2,3),(4,5,6)]) 2darray
np.arrange(start,stop,step) rangearray
np.linespace(0,2,9) Addevenlyspacedvaluesbtwintervaltoarrayof length
np.zeros((1,2)) Createandarrayfilledwithzeros
np.ones((1,2)) Createsanarrayfilledwithones
np.random.random((5,5)) Createsrandomarray
np.empty((2,2)) Createsanempty array
INITIALIZTION
Array Properties
Syntax Description
array.shape Dimensions(Rows,Columns)
len(array) Lengthof Array
array.ndim NumberofArrayDimensions
array.size NumberofArrayElements
array.dtype DataType
type(array) TypeofArray
Copying & Shorting
np.copy(array) Creates copy of array
array.sort() Sortsanarray
array.sort(axis=0) Sortsaxisofarray
Operations
Operator Description
np.add(x,y) x + y Addition
np.substract(x,y) x –y Subtraction
np.divide(x,y)
x / y
Division
np.multiply(x,y) x *y Multiplication
np.sqrt(x) SquareRoot
np.sin(x) Element-wisesine
np.cos(x) Element-wisecosine
np.log(x) Element-wisenaturallog
np.dot(x,y) Dotproduct
np.roots([1,0,-4]) Rootsofagivenpolynomialcoefficients
Thank
You...
Abhijeet Anand (A.I & D.S)

More Related Content

What's hot (20)

PPTX
Introduction to numpy
Gaurav Aggarwal
 
PPTX
Numpy
Jyoti shukla
 
PPTX
Python Scipy Numpy
Girish Khanzode
 
PDF
Python NumPy Tutorial | NumPy Array | Edureka
Edureka!
 
PPTX
MatplotLib.pptx
Paras Intotech
 
PPTX
PPT on Data Science Using Python
NishantKumar1179
 
PPTX
Regular expressions in Python
Sujith Kumar
 
PPTX
Data Analysis in Python-NumPy
Devashish Kumar
 
PPTX
Packages In Python Tutorial
Simplilearn
 
PPTX
Variables in python
Jaya Kumari
 
PDF
Python for Data Science
Harri Hämäläinen
 
PPTX
File Handling Python
Akhil Kaushik
 
PDF
Data Visualization in Python
Jagriti Goswami
 
PDF
Python Basics
tusharpanda88
 
PDF
Introduction to Python Pandas for Data Analytics
Phoenix
 
PPTX
List in Python
Siddique Ibrahim
 
PDF
Datatypes in python
eShikshak
 
PPTX
Introduction to matplotlib
Piyush rai
 
PPTX
File handling in Python
Megha V
 
PDF
Variables & Data Types In Python | Edureka
Edureka!
 
Introduction to numpy
Gaurav Aggarwal
 
Python Scipy Numpy
Girish Khanzode
 
Python NumPy Tutorial | NumPy Array | Edureka
Edureka!
 
MatplotLib.pptx
Paras Intotech
 
PPT on Data Science Using Python
NishantKumar1179
 
Regular expressions in Python
Sujith Kumar
 
Data Analysis in Python-NumPy
Devashish Kumar
 
Packages In Python Tutorial
Simplilearn
 
Variables in python
Jaya Kumari
 
Python for Data Science
Harri Hämäläinen
 
File Handling Python
Akhil Kaushik
 
Data Visualization in Python
Jagriti Goswami
 
Python Basics
tusharpanda88
 
Introduction to Python Pandas for Data Analytics
Phoenix
 
List in Python
Siddique Ibrahim
 
Datatypes in python
eShikshak
 
Introduction to matplotlib
Piyush rai
 
File handling in Python
Megha V
 
Variables & Data Types In Python | Edureka
Edureka!
 

Similar to NumPy (20)

PPTX
NumPy.pptx
DrJasmineBeulahG
 
PPTX
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
PDF
numpy.pdf
DrSudheerHanumanthak
 
PPTX
Introduction-to-NumPy-in-Python (1).pptx
disserdekabrcha
 
PPTX
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
SovannDoeur
 
DOCX
Numpy
SanthoshPa2
 
PPTX
Introduction to numpy.pptx
ssuser0e701a
 
PPTX
NUMPY [Autosaved] .pptx
coolmanbalu123
 
PPT
CAP776Numpy (2).ppt
ChhaviCoachingCenter
 
PPT
CAP776Numpy.ppt
kdr52121
 
PPTX
Week 11.pptx
CruiseCH
 
PPTX
numpy code and examples with attributes.pptx
swathis752031
 
PPTX
NumPy.pptx
Govardhan Bhavani
 
PPTX
NumPy.pptx
EN1036VivekSingh
 
PPTX
NUMPY-2.pptx
MahendraVusa
 
PPTX
Numpy.pptx
sureshR340784
 
PPTX
Lecture 2 _Foundions foundions NumPyI.pptx
disserdekabrcha
 
PPTX
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
RahinTamboli
 
PPTX
Numpy Library introducton in Python.pptx
RohmaQadir
 
PPTX
object oriented programing in python and pip
LakshmiMarineni
 
NumPy.pptx
DrJasmineBeulahG
 
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
Introduction-to-NumPy-in-Python (1).pptx
disserdekabrcha
 
Chapter 4 NumPy Basics Arrays and Vectorized Computation (Part I).pptx
SovannDoeur
 
Introduction to numpy.pptx
ssuser0e701a
 
NUMPY [Autosaved] .pptx
coolmanbalu123
 
CAP776Numpy (2).ppt
ChhaviCoachingCenter
 
CAP776Numpy.ppt
kdr52121
 
Week 11.pptx
CruiseCH
 
numpy code and examples with attributes.pptx
swathis752031
 
NumPy.pptx
Govardhan Bhavani
 
NumPy.pptx
EN1036VivekSingh
 
NUMPY-2.pptx
MahendraVusa
 
Numpy.pptx
sureshR340784
 
Lecture 2 _Foundions foundions NumPyI.pptx
disserdekabrcha
 
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
RahinTamboli
 
Numpy Library introducton in Python.pptx
RohmaQadir
 
object oriented programing in python and pip
LakshmiMarineni
 
Ad

Recently uploaded (20)

PPTX
Sensor IC System Design Using COMSOL Multiphysics 2025-July.pptx
James D.B. Wang, PhD
 
PDF
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
PPTX
ENG8 Q1, WEEK 4.pptxoooiioooooooooooooooooooooooooo
chubbychubz1
 
PPTX
Mining Presentation Underground - Copy.pptx
patallenmoore
 
PDF
A NEW FAMILY OF OPTICALLY CONTROLLED LOGIC GATES USING NAPHTHOPYRAN MOLECULE
ijoejnl
 
PDF
1_ISO Certifications by Indian Industrial Standards Organisation.pdf
muhammad2010960
 
PDF
th International conference on Big Data, Machine learning and Applications (B...
Zac Darcy
 
PDF
NOISE CONTROL ppt - SHRESTH SUDHIR KOKNE
SHRESTHKOKNE
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
ENSA_Module_8.pptx_nice_ipsec_presentation
RanaMukherjee24
 
PPT
Hazard identification and risk assessment PPT
SUNILARORA51
 
PDF
An Evaluative Study on Performance Growth Plan of ICICI Mutual Fund and SBI M...
PoonamKilaniya
 
PDF
LEARNING CROSS-LINGUAL WORD EMBEDDINGS WITH UNIVERSAL CONCEPTS
kjim477n
 
PDF
The Complete Guide to the Role of the Fourth Engineer On Ships
Mahmoud Moghtaderi
 
PPT
04 Origin of Evinnnnnnnnnnnnnnnnnnnnnnnnnnl-notes.ppt
LuckySangalala1
 
PDF
mosfet introduction engg topic for students.pdf
trsureshkumardata
 
PDF
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 
PDF
13th International Conference of Networks and Communications (NC 2025)
JohannesPaulides
 
PPTX
Cyclic_Redundancy_Check_Presentation.pptx
alhjranyblalhmwdbdal
 
PDF
Natural Language processing and web deigning notes
AnithaSakthivel3
 
Sensor IC System Design Using COMSOL Multiphysics 2025-July.pptx
James D.B. Wang, PhD
 
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
ENG8 Q1, WEEK 4.pptxoooiioooooooooooooooooooooooooo
chubbychubz1
 
Mining Presentation Underground - Copy.pptx
patallenmoore
 
A NEW FAMILY OF OPTICALLY CONTROLLED LOGIC GATES USING NAPHTHOPYRAN MOLECULE
ijoejnl
 
1_ISO Certifications by Indian Industrial Standards Organisation.pdf
muhammad2010960
 
th International conference on Big Data, Machine learning and Applications (B...
Zac Darcy
 
NOISE CONTROL ppt - SHRESTH SUDHIR KOKNE
SHRESTHKOKNE
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
ENSA_Module_8.pptx_nice_ipsec_presentation
RanaMukherjee24
 
Hazard identification and risk assessment PPT
SUNILARORA51
 
An Evaluative Study on Performance Growth Plan of ICICI Mutual Fund and SBI M...
PoonamKilaniya
 
LEARNING CROSS-LINGUAL WORD EMBEDDINGS WITH UNIVERSAL CONCEPTS
kjim477n
 
The Complete Guide to the Role of the Fourth Engineer On Ships
Mahmoud Moghtaderi
 
04 Origin of Evinnnnnnnnnnnnnnnnnnnnnnnnnnl-notes.ppt
LuckySangalala1
 
mosfet introduction engg topic for students.pdf
trsureshkumardata
 
勉強会資料_An Image is Worth More Than 16x16 Patches
NABLAS株式会社
 
13th International Conference of Networks and Communications (NC 2025)
JohannesPaulides
 
Cyclic_Redundancy_Check_Presentation.pptx
alhjranyblalhmwdbdal
 
Natural Language processing and web deigning notes
AnithaSakthivel3
 
Ad

NumPy

  • 1. Name : Abhijeet Anand Dept : A.I&D.S Roll No. : 20AD001 Reg no : 201201001 Date : 07-09-2021 Topic : NumPy
  • 4. What is NumPy ? NumPy Stands For Numerical Python. NumPy is a Python library used for working with array NumPy is the fundamental package for scientific computing in Python. It also has functions for working in domain of linear algebra, Fourier transform, and matrices. NumPy was created in 2005 by Travis Oliphant. It is an open source project and you can use it freely.
  • 5. Why Use NumPy ? In Python we have lists that serve the purpose of arrays, but they are slow to process. NumPy aims to provide an array object that is up to 50x faster than traditional Python lists. The Array object in NumPy is called ndarray, it provides a lot of supporting functions that make working with ndarray very easy. Arrays are very frequently used in data science, where speed and resources are very important.
  • 6. Why is NumPy Faster Than Lists? NumPy arrays are stored at one continuous place in memory unlike lists, so processes can access and manipulate them very efficiently. This behavior is called locality of reference in computer science. This is the main reason why NumPy is faster than lists. Also it is optimized to work with latest CPU architectures.
  • 7. Arrays in NumPy An Array is a collection of values, organized in a specific order. NumPy’s main object is the homogeneous multidimensional array. It is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers. In NumPy dimensions are called axis. The number of axis is rank. NumPy’s array class is called ndarray. It is also known by the alias array.
  • 9. 1-D Array An array that has 0-D arrays as its elements is called uni-dimensional or 1-D array . These are the most common and basic arrays Import numpy as np arr = np.array([1, 2, 3, 4, 5]) print(arr)
  • 10. 2-D Array An array that has 1-D arrays as its elements is called a 2- D array.These are often used to represent matrix or 2nd order tensors. Import numpy as np arr = np.array([[1, 2, 3], [4, 5,6]]) print(arr)
  • 11. 3-D Arrays An array that has 2-D arrays (matrices) as its elements is called 3-D array.These are often used to represent a 3rd order tensor. Import numpy as np arr = np.array([[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]]) print(arr)
  • 12. np.array([1,2,3]) 1d array np.array([(1,2,3),(4,5,6)]) 2darray np.arrange(start,stop,step) rangearray np.linespace(0,2,9) Addevenlyspacedvaluesbtwintervaltoarrayof length np.zeros((1,2)) Createandarrayfilledwithzeros np.ones((1,2)) Createsanarrayfilledwithones np.random.random((5,5)) Createsrandomarray np.empty((2,2)) Createsanempty array INITIALIZTION
  • 13. Array Properties Syntax Description array.shape Dimensions(Rows,Columns) len(array) Lengthof Array array.ndim NumberofArrayDimensions array.size NumberofArrayElements array.dtype DataType type(array) TypeofArray
  • 14. Copying & Shorting np.copy(array) Creates copy of array array.sort() Sortsanarray array.sort(axis=0) Sortsaxisofarray
  • 15. Operations Operator Description np.add(x,y) x + y Addition np.substract(x,y) x –y Subtraction np.divide(x,y) x / y Division np.multiply(x,y) x *y Multiplication np.sqrt(x) SquareRoot np.sin(x) Element-wisesine np.cos(x) Element-wisecosine np.log(x) Element-wisenaturallog np.dot(x,y) Dotproduct np.roots([1,0,-4]) Rootsofagivenpolynomialcoefficients