SlideShare a Scribd company logo
Introduction to
numpy
Term paper-
Programming II
Submitted to:
Dr. Dharmendra Singh
Submitted by :
Gaurav
19mslsbf03
Table of Contents
 Introduction
 Operations using NumPy
 NumPy – A Replacement for MatLab
Installation of numpy package on Linux-Ubuntu
Numpy-ndarray
Numpy-matplotlib
Introduction
• NumPy is a Python package. It stands for 'Numerical
Python'. It is a library consisting of multidimensional array
objects and a collection of routines for processing of array.
• Numeric, the ancestor of NumPy, was developed by Jim
Hugunin. Another package Numarray was also developed,
having some additional functionalities. In 2005, Travis
Oliphant created NumPy package by incorporating the
features of Numarray into Numeric package. There are
many contributors to this open source project.
Operations using NumPy
Using NumPy, a developer can perform the following operations −
Mathematical and logical operations on arrays.
Fourier transforms and routines for shape manipulation.
Operations related to linear algebra. NumPy has in-built functions for
linear algebra and random number generation.
NumPy – A Replacement for MatLab
NumPy is often used along with packages like SciPy (Scientific
Python) and Mat−plotlib (plotting library). This combination is
widely used as a replacement for MatLab, a popular platform for
technical computing. However, Python alternative to MatLab is now
seen as a more modern and complete programming language.
It is open source, which is an added advantage of NumPy.
Installation of numpy package on Linux-Ubuntu
⁓$sudo apt-get install python-numpy
python-scipy python-
matplotlibipythonipythonnotebook
python-pandas python-sympy python-
nose
Use this command in the Terminal of Ubuntu system
to install numpy package
Numpy-ndarray
• The most important object defined in NumPy is an N-dimensional
array type called ndarray. It describes the collection of items of
the same type. Items in the collection can be accessed using a
zero-based index.
• Every item in an ndarray takes the same size of block in the
memory. Each element in ndarray is an object of data-type object
(called dtype).
Example
import numpy as np
a = np.array([1,2,3])
print a
import numpy as np
a = np.array([[1, 2], [3, 4]])
print a
import numpy as np
a = np.array([1, 2, 3,4,5], ndmin = 2)
print a
import numpy as np
a = np.array([1, 2, 3], dtype = complex)
print a
Numpy-Matplotlib
import numpy as np
from matplotlib import pyplot as plt
x = np.arange(1,11)
y = 2 * x + 5
plt.title("Matplotlib demo")
plt.xlabel("x axis caption")
plt.ylabel("y axis caption")
plt.plot(x,y)
plt.show()
import numpy as np
from matplotlib import pyplot as plt
x = np.arange(1,11)
y = 2 * x + 5
plt.title("Matplotlib demo")
plt.xlabel("x axis caption")
plt.ylabel("y axis caption")
plt.plot(x,y,"ob")
plt.show()
import numpy as np
import matplotlib.pyplot as plt
# Compute the x and y coordinates
for points on a sine curve
x = np.arange(0, 3 * np.pi, 0.1)
y = np.sin(x)
plt.title("sine wave form")
# Plot the points using matplotlib
plt.plot(x, y)
plt.show()
Sine Wave Plot
bar()
from matplotlib import pyplot as plt
x = [5,8,10]
y = [12,16,6]
x2 = [6,9,11]
y2 = [6,15,7]
plt.bar(x, y, align = 'center')
plt.bar(x2, y2, color = 'g', align = 'center')
plt.title('Bar graph')
plt.ylabel('Y axis')
plt.xlabel('X axis')
plt.show()
References
https://www.tutorialspoint.com/numpy
https://www.tutorialspoint.com/numpy/numpy_matplotlib.htm
https://www.tutorialspoint.com/numpy/numpy_ndarray_object.
htm
Ad

More Related Content

What's hot (20)

pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
Andrew Henshaw
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
NUMPY
NUMPY NUMPY
NUMPY
SharmilaChidaravalli
 
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
MahendraVusa
 
Python pandas Library
Python pandas LibraryPython pandas Library
Python pandas Library
Md. Sohag Miah
 
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
PyData
 
Scientific Computing with Python - NumPy | WeiYuan
Scientific Computing with Python - NumPy | WeiYuanScientific Computing with Python - NumPy | WeiYuan
Scientific Computing with Python - NumPy | WeiYuan
Wei-Yuan Chang
 
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 Analysis and Visualization using Python
Data Analysis and Visualization using PythonData Analysis and Visualization using Python
Data Analysis and Visualization using Python
Chariza Pladin
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
Piyush rai
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
EN1036VivekSingh
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]
Alexander Hendorf
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
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 For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
Essential NumPy
Essential NumPyEssential NumPy
Essential NumPy
zekeLabs Technologies
 
Data Visualization in Python
Data Visualization in PythonData Visualization in Python
Data Visualization in Python
Jagriti Goswami
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
Elavarasi K
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 
Knuth morris pratt string matching algo
Knuth morris pratt string matching algoKnuth morris pratt string matching algo
Knuth morris pratt string matching algo
sabiya sabiya
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
Andrew Henshaw
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
 
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
PyData
 
Scientific Computing with Python - NumPy | WeiYuan
Scientific Computing with Python - NumPy | WeiYuanScientific Computing with Python - NumPy | WeiYuan
Scientific Computing with Python - NumPy | WeiYuan
Wei-Yuan Chang
 
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 Analysis and Visualization using Python
Data Analysis and Visualization using PythonData Analysis and Visualization using Python
Data Analysis and Visualization using Python
Chariza Pladin
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
Piyush rai
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]
Alexander Hendorf
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
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 For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Python For Data Analysis | Python Pandas Tutorial | Learn Python | Python Tra...
Edureka!
 
Data Visualization in Python
Data Visualization in PythonData Visualization in Python
Data Visualization in Python
Jagriti Goswami
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
Elavarasi K
 
Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...Data Science With Python | Python For Data Science | Python Data Science Cour...
Data Science With Python | Python For Data Science | Python Data Science Cour...
Simplilearn
 
Knuth morris pratt string matching algo
Knuth morris pratt string matching algoKnuth morris pratt string matching algo
Knuth morris pratt string matching algo
sabiya sabiya
 

Similar to Introduction to numpy (20)

NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
Paras Intotech
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
Introduction-to-NumPy-in-Python (1).pptx
Introduction-to-NumPy-in-Python (1).pptxIntroduction-to-NumPy-in-Python (1).pptx
Introduction-to-NumPy-in-Python (1).pptx
disserdekabrcha
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
Govardhan Bhavani
 
Numpy
NumpyNumpy
Numpy
SanthoshPa2
 
Python for ML.pptx
Python for ML.pptxPython for ML.pptx
Python for ML.pptx
Dr. Amanpreet Kaur
 
Introduction to Numpy, NumPy Arrays.pdf
Introduction to Numpy, NumPy  Arrays.pdfIntroduction to Numpy, NumPy  Arrays.pdf
Introduction to Numpy, NumPy Arrays.pdf
sumitt6_25730773
 
Numpy.pptx
Numpy.pptxNumpy.pptx
Numpy.pptx
sureshR340784
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
DrJasmineBeulahG
 
Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
ssuser0e701a
 
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
 
Python 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptxPython 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptx
ChetanRaut43
 
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjibPresentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
RahinTamboli
 
Demo1 use numpy
Demo1 use numpyDemo1 use numpy
Demo1 use numpy
Romaric Saounde Tsopnang
 
CAP776Numpy.ppt
CAP776Numpy.pptCAP776Numpy.ppt
CAP776Numpy.ppt
kdr52121
 
CAP776Numpy (2).ppt
CAP776Numpy (2).pptCAP776Numpy (2).ppt
CAP776Numpy (2).ppt
ChhaviCoachingCenter
 
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptxL-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
baadshahyash
 
Kaggle tokyo 2018
Kaggle tokyo 2018Kaggle tokyo 2018
Kaggle tokyo 2018
Cournapeau David
 
CDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - IntroductionCDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - Introduction
Arulalan T
 
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
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 
Introduction-to-NumPy-in-Python (1).pptx
Introduction-to-NumPy-in-Python (1).pptxIntroduction-to-NumPy-in-Python (1).pptx
Introduction-to-NumPy-in-Python (1).pptx
disserdekabrcha
 
Introduction to Numpy, NumPy Arrays.pdf
Introduction to Numpy, NumPy  Arrays.pdfIntroduction to Numpy, NumPy  Arrays.pdf
Introduction to Numpy, NumPy Arrays.pdf
sumitt6_25730773
 
Introduction to numpy.pptx
Introduction to numpy.pptxIntroduction to numpy.pptx
Introduction to numpy.pptx
ssuser0e701a
 
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
 
Python 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptxPython 8416516 16 196 46 5163 51 63 51 6.pptx
Python 8416516 16 196 46 5163 51 63 51 6.pptx
ChetanRaut43
 
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjibPresentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
Presentation1.pptxvghvfhgvbn nbnmbnbjkbjkbjib
RahinTamboli
 
CAP776Numpy.ppt
CAP776Numpy.pptCAP776Numpy.ppt
CAP776Numpy.ppt
kdr52121
 
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptxL-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
L-30-35huujjjhgjnnjhggbjkiuuhhjkiiijj.pptx
baadshahyash
 
CDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - IntroductionCDAT - cdms numpy arrays - Introduction
CDAT - cdms numpy arrays - Introduction
Arulalan T
 
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
 
Ad

More from Gaurav Aggarwal (12)

Optimal gene circuit design
Optimal gene circuit designOptimal gene circuit design
Optimal gene circuit design
Gaurav Aggarwal
 
Ethics in assisted reproductive technologies
Ethics in assisted reproductive technologiesEthics in assisted reproductive technologies
Ethics in assisted reproductive technologies
Gaurav Aggarwal
 
Descriptors
DescriptorsDescriptors
Descriptors
Gaurav Aggarwal
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
Gaurav Aggarwal
 
Epidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Epidemiology, Genetic Recombination, and Pathogenesis of CoronavirusesEpidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Epidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Gaurav Aggarwal
 
Sequence analysis
Sequence analysisSequence analysis
Sequence analysis
Gaurav Aggarwal
 
Immunity to microbes
Immunity to microbesImmunity to microbes
Immunity to microbes
Gaurav Aggarwal
 
Challenges and drawbacks of drug discovery and development
Challenges and drawbacks of drug discovery and developmentChallenges and drawbacks of drug discovery and development
Challenges and drawbacks of drug discovery and development
Gaurav Aggarwal
 
Nucleus
NucleusNucleus
Nucleus
Gaurav Aggarwal
 
Forces stabilizing nucleic acid structure
Forces stabilizing nucleic acid structureForces stabilizing nucleic acid structure
Forces stabilizing nucleic acid structure
Gaurav Aggarwal
 
Memory management in python
Memory management in pythonMemory management in python
Memory management in python
Gaurav Aggarwal
 
Enzyme catalysis
Enzyme catalysisEnzyme catalysis
Enzyme catalysis
Gaurav Aggarwal
 
Optimal gene circuit design
Optimal gene circuit designOptimal gene circuit design
Optimal gene circuit design
Gaurav Aggarwal
 
Ethics in assisted reproductive technologies
Ethics in assisted reproductive technologiesEthics in assisted reproductive technologies
Ethics in assisted reproductive technologies
Gaurav Aggarwal
 
Epidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Epidemiology, Genetic Recombination, and Pathogenesis of CoronavirusesEpidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Epidemiology, Genetic Recombination, and Pathogenesis of Coronaviruses
Gaurav Aggarwal
 
Challenges and drawbacks of drug discovery and development
Challenges and drawbacks of drug discovery and developmentChallenges and drawbacks of drug discovery and development
Challenges and drawbacks of drug discovery and development
Gaurav Aggarwal
 
Forces stabilizing nucleic acid structure
Forces stabilizing nucleic acid structureForces stabilizing nucleic acid structure
Forces stabilizing nucleic acid structure
Gaurav Aggarwal
 
Memory management in python
Memory management in pythonMemory management in python
Memory management in python
Gaurav Aggarwal
 
Ad

Recently uploaded (20)

04302025_CCC TUG_DataVista: The Design Story
04302025_CCC TUG_DataVista: The Design Story04302025_CCC TUG_DataVista: The Design Story
04302025_CCC TUG_DataVista: The Design Story
ccctableauusergroup
 
Geometry maths presentation for begginers
Geometry maths presentation for begginersGeometry maths presentation for begginers
Geometry maths presentation for begginers
zrjacob283
 
How iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost FundsHow iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost Funds
ireneschmid345
 
How to join illuminati Agent in uganda call+256776963507/0741506136
How to join illuminati Agent in uganda call+256776963507/0741506136How to join illuminati Agent in uganda call+256776963507/0741506136
How to join illuminati Agent in uganda call+256776963507/0741506136
illuminati Agent uganda call+256776963507/0741506136
 
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.pptJust-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
ssuser5f8f49
 
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
gmuir1066
 
Simple_AI_Explanation_English somplr.pptx
Simple_AI_Explanation_English somplr.pptxSimple_AI_Explanation_English somplr.pptx
Simple_AI_Explanation_English somplr.pptx
ssuser2aa19f
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptxPerencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
PareaRusan
 
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdfIAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
mcgardenlevi9
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
Principles of information security Chapter 5.ppt
Principles of information security Chapter 5.pptPrinciples of information security Chapter 5.ppt
Principles of information security Chapter 5.ppt
EstherBaguma
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
C++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptxC++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptx
aquibnoor22079
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
Deloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit contextDeloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit context
Process mining Evangelist
 
VKS-Python Basics for Beginners and advance.pptx
VKS-Python Basics for Beginners and advance.pptxVKS-Python Basics for Beginners and advance.pptx
VKS-Python Basics for Beginners and advance.pptx
Vinod Srivastava
 
Data Analytics Overview and its applications
Data Analytics Overview and its applicationsData Analytics Overview and its applications
Data Analytics Overview and its applications
JanmejayaMishra7
 
Medical Dataset including visualizations
Medical Dataset including visualizationsMedical Dataset including visualizations
Medical Dataset including visualizations
vishrut8750588758
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 
04302025_CCC TUG_DataVista: The Design Story
04302025_CCC TUG_DataVista: The Design Story04302025_CCC TUG_DataVista: The Design Story
04302025_CCC TUG_DataVista: The Design Story
ccctableauusergroup
 
Geometry maths presentation for begginers
Geometry maths presentation for begginersGeometry maths presentation for begginers
Geometry maths presentation for begginers
zrjacob283
 
How iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost FundsHow iCode cybertech Helped Me Recover My Lost Funds
How iCode cybertech Helped Me Recover My Lost Funds
ireneschmid345
 
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.pptJust-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
Just-In-Timeasdfffffffghhhhhhhhhhj Systems.ppt
ssuser5f8f49
 
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
Adobe Analytics NOAM Central User Group April 2025 Agent AI: Uncovering the S...
gmuir1066
 
Simple_AI_Explanation_English somplr.pptx
Simple_AI_Explanation_English somplr.pptxSimple_AI_Explanation_English somplr.pptx
Simple_AI_Explanation_English somplr.pptx
ssuser2aa19f
 
Cleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdfCleaned_Lecture 6666666_Simulation_I.pdf
Cleaned_Lecture 6666666_Simulation_I.pdf
alcinialbob1234
 
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptxPerencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
Perencanaan Pengendalian-Proyek-Konstruksi-MS-PROJECT.pptx
PareaRusan
 
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdfIAS-slides2-ia-aaaaaaaaaaain-business.pdf
IAS-slides2-ia-aaaaaaaaaaain-business.pdf
mcgardenlevi9
 
Digilocker under workingProcess Flow.pptx
Digilocker  under workingProcess Flow.pptxDigilocker  under workingProcess Flow.pptx
Digilocker under workingProcess Flow.pptx
satnamsadguru491
 
Principles of information security Chapter 5.ppt
Principles of information security Chapter 5.pptPrinciples of information security Chapter 5.ppt
Principles of information security Chapter 5.ppt
EstherBaguma
 
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptxStack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
binduraniha86
 
C++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptxC++_OOPs_DSA1_Presentation_Template.pptx
C++_OOPs_DSA1_Presentation_Template.pptx
aquibnoor22079
 
VKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptxVKS-Python-FIe Handling text CSV Binary.pptx
VKS-Python-FIe Handling text CSV Binary.pptx
Vinod Srivastava
 
Deloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit contextDeloitte Analytics - Applying Process Mining in an audit context
Deloitte Analytics - Applying Process Mining in an audit context
Process mining Evangelist
 
VKS-Python Basics for Beginners and advance.pptx
VKS-Python Basics for Beginners and advance.pptxVKS-Python Basics for Beginners and advance.pptx
VKS-Python Basics for Beginners and advance.pptx
Vinod Srivastava
 
Data Analytics Overview and its applications
Data Analytics Overview and its applicationsData Analytics Overview and its applications
Data Analytics Overview and its applications
JanmejayaMishra7
 
Medical Dataset including visualizations
Medical Dataset including visualizationsMedical Dataset including visualizations
Medical Dataset including visualizations
vishrut8750588758
 
Data Science Courses in India iim skills
Data Science Courses in India iim skillsData Science Courses in India iim skills
Data Science Courses in India iim skills
dharnathakur29
 

Introduction to numpy

  • 2. Term paper- Programming II Submitted to: Dr. Dharmendra Singh Submitted by : Gaurav 19mslsbf03
  • 3. Table of Contents  Introduction  Operations using NumPy  NumPy – A Replacement for MatLab Installation of numpy package on Linux-Ubuntu Numpy-ndarray Numpy-matplotlib
  • 4. Introduction • NumPy is a Python package. It stands for 'Numerical Python'. It is a library consisting of multidimensional array objects and a collection of routines for processing of array. • Numeric, the ancestor of NumPy, was developed by Jim Hugunin. Another package Numarray was also developed, having some additional functionalities. In 2005, Travis Oliphant created NumPy package by incorporating the features of Numarray into Numeric package. There are many contributors to this open source project.
  • 5. Operations using NumPy Using NumPy, a developer can perform the following operations − Mathematical and logical operations on arrays. Fourier transforms and routines for shape manipulation. Operations related to linear algebra. NumPy has in-built functions for linear algebra and random number generation. NumPy – A Replacement for MatLab NumPy is often used along with packages like SciPy (Scientific Python) and Mat−plotlib (plotting library). This combination is widely used as a replacement for MatLab, a popular platform for technical computing. However, Python alternative to MatLab is now seen as a more modern and complete programming language. It is open source, which is an added advantage of NumPy.
  • 6. Installation of numpy package on Linux-Ubuntu ⁓$sudo apt-get install python-numpy python-scipy python- matplotlibipythonipythonnotebook python-pandas python-sympy python- nose Use this command in the Terminal of Ubuntu system to install numpy package
  • 7. Numpy-ndarray • The most important object defined in NumPy is an N-dimensional array type called ndarray. It describes the collection of items of the same type. Items in the collection can be accessed using a zero-based index. • Every item in an ndarray takes the same size of block in the memory. Each element in ndarray is an object of data-type object (called dtype).
  • 8. Example import numpy as np a = np.array([1,2,3]) print a import numpy as np a = np.array([[1, 2], [3, 4]]) print a import numpy as np a = np.array([1, 2, 3,4,5], ndmin = 2) print a import numpy as np a = np.array([1, 2, 3], dtype = complex) print a
  • 9. Numpy-Matplotlib import numpy as np from matplotlib import pyplot as plt x = np.arange(1,11) y = 2 * x + 5 plt.title("Matplotlib demo") plt.xlabel("x axis caption") plt.ylabel("y axis caption") plt.plot(x,y) plt.show()
  • 10. import numpy as np from matplotlib import pyplot as plt x = np.arange(1,11) y = 2 * x + 5 plt.title("Matplotlib demo") plt.xlabel("x axis caption") plt.ylabel("y axis caption") plt.plot(x,y,"ob") plt.show()
  • 11. import numpy as np import matplotlib.pyplot as plt # Compute the x and y coordinates for points on a sine curve x = np.arange(0, 3 * np.pi, 0.1) y = np.sin(x) plt.title("sine wave form") # Plot the points using matplotlib plt.plot(x, y) plt.show() Sine Wave Plot
  • 12. bar() from matplotlib import pyplot as plt x = [5,8,10] y = [12,16,6] x2 = [6,9,11] y2 = [6,15,7] plt.bar(x, y, align = 'center') plt.bar(x2, y2, color = 'g', align = 'center') plt.title('Bar graph') plt.ylabel('Y axis') plt.xlabel('X axis') plt.show()