Jyoti Shukla (SME)
Jyoti Shukla (SME)
Topics
Introduction of Numpy
Indexing & slicing
Mathematical computation
Array comparison
array Manipulation
transpose & swapcase
insert and remove
Topics
What is Numpy?
Why Numpy?
What is Array?
Dimensions in Arrays
Initialization of an Array.
What is Numerical Python?
NumPy is the fundamental package for scientific
computing with Python.
A powerful N-dimensional array object
Sophisticated (broadcasting) functions
Tools for integrating C/C++ and Fortran code
Useful linear algebra, Fourier transform, and random
number capabilities
Why NumPy?
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
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 axes. The number of
axes is rank.
NumPy’s array class is called ndarray. It is also known
by the alias array.
Dimensions in Arrays
np.array([(1,2,3),(4,5,6)]) 2d array
Syntax Description
np.add(x,y)
Addition
x + y
np.substract(x,y)
Subtraction
x – y
np.divide(x,y)
Division
x / y
np.multiply(x,y)
Multiplication
x @ y