NumPy
Understanding NumPy Arrays,
Operations, and Indexing
Introduction to NumPy
• NumPy (Numerical Python) is a library for
numerical computing in Python. It provides
support for multi-dimensional arrays and
mathematical functions.
Creating NumPy Arrays
• - From Python Lists: np.array([1, 2, 3])
• - From Built-in Methods: np.zeros(), np.ones(),
np.arange(), np.linspace()
• - From Random Module: np.random.rand(),
np.random.randint()
Array Attributes and Methods
• - Reshape: arr.reshape(3,3)
• - Max & Min: arr.max(), arr.min()
• - Argmax & Argmin: arr.argmax(), arr.argmin()
• - Shape: arr.shape
• - Dtype: arr.dtype
• - Size: arr.size
• - Ndim: arr.ndim
Operations on Arrays
• - Copying: arr.copy()
• - Appending & Inserting: np.append(),
np.insert()
• - Sorting: np.sort()
• - Removing: np.delete()
• - Concatenation: np.concatenate()
• - Splitting: np.split()
Data Loading & Saving
• - Save: np.save('file.npy', arr)
• - Load: np.load('file.npy')
• - CSV Handling: np.savetxt('file.csv', arr),
np.loadtxt('file.csv')
NumPy Indexing and Selection
• - Indexing 2D Array: arr[1,2]
• - Logical Selection: arr[arr > 3]
Broadcasting in NumPy
• - Perform operations on arrays of different
shapes without manual resizing
• - Example: arr + 5, arr1 + arr2 (with different
shapes)

More Related Content

PPTX
Usage of Python NumPy, 1Dim, 2Dim Arrays
PDF
ACFrOgAabSLW3ZCRLJ0i-To_2fPk_pA9QThyDKNNlA3VK282MnXaLGJa7APKD15-TW9zT_QI98dAH...
PPTX
NUMPY [Autosaved] .pptx
PPTX
NumPy-python-27-9-24-we.pptxNumPy-python-27-9-24-we.pptx
PPTX
numpydocococ34554367827839271966666.pptx
PPT
CAP776Numpy (2).ppt
PPT
CAP776Numpy.ppt
PPTX
NUMPY-2.pptx
Usage of Python NumPy, 1Dim, 2Dim Arrays
ACFrOgAabSLW3ZCRLJ0i-To_2fPk_pA9QThyDKNNlA3VK282MnXaLGJa7APKD15-TW9zT_QI98dAH...
NUMPY [Autosaved] .pptx
NumPy-python-27-9-24-we.pptxNumPy-python-27-9-24-we.pptx
numpydocococ34554367827839271966666.pptx
CAP776Numpy (2).ppt
CAP776Numpy.ppt
NUMPY-2.pptx

Similar to NumPy_Presentation about Numerical python.pptx (20)

PPTX
1.NumPy is a Python library used for wor
PPTX
NUMPY LIBRARY study materials PPT 2.pptx
PPTX
NumPy.pptx
PPTX
Data Preprocessing Introduction for Machine Learning
PPTX
Introduction to numpy Session 1
PPTX
PDF
Introduction to NumPy (PyData SV 2013)
PDF
Introduction to NumPy
PDF
Numpy python cheat_sheet
PDF
Numpy python cheat_sheet
PDF
CDAT - cdms numpy arrays - Introduction
PPTX
Numpy in python, Array operations using numpy and so on
PDF
Python_cheatsheet_numpy.pdf
PPTX
Introduction-to-NumPy-in-Python (1).pptx
PPTX
NumPy.pptx
PDF
‏‏Lecture 2.pdf
PDF
PPTX
Introduction to numpy.pptx
PPTX
numpy code and examples with attributes.pptx
PDF
Numpy ndarrays.pdf
1.NumPy is a Python library used for wor
NUMPY LIBRARY study materials PPT 2.pptx
NumPy.pptx
Data Preprocessing Introduction for Machine Learning
Introduction to numpy Session 1
Introduction to NumPy (PyData SV 2013)
Introduction to NumPy
Numpy python cheat_sheet
Numpy python cheat_sheet
CDAT - cdms numpy arrays - Introduction
Numpy in python, Array operations using numpy and so on
Python_cheatsheet_numpy.pdf
Introduction-to-NumPy-in-Python (1).pptx
NumPy.pptx
‏‏Lecture 2.pdf
Introduction to numpy.pptx
numpy code and examples with attributes.pptx
Numpy ndarrays.pdf
Ad

More from sarfarazkhanwattoo (13)

PPTX
Self-Balancing BSTs,K Dimensional Tree.pptx
PPTX
Muhammad Sarfaraz(Presentation) Final.pptx
PPTX
RDKit python libraries one famous about chemistry (.pptx
PPTX
sibgh python importance for chemistry .pptx
PPTX
chempy ,this is the presentaion for chemistry .pptx
PPTX
jawad Internship this is the presentation (1).pptx
PPTX
Information security presentation donwe.pptx
PPTX
Automatic interactive charts presentation for show.pptx
PPTX
Lecture 5,6 [Autosavedaot IOT ]slides.pptx
PPTX
MAHA PPT.pptx kncksd jkk cjkc kjkdsl alknxk
PPTX
ARM PRESENTATION Final version.pptx jsjdkwn
PPTX
Matplotlib_Presentation jk jdjklskncncsjkk
PPTX
NLP_presentation on machine learning for human - Copy.pptx
Self-Balancing BSTs,K Dimensional Tree.pptx
Muhammad Sarfaraz(Presentation) Final.pptx
RDKit python libraries one famous about chemistry (.pptx
sibgh python importance for chemistry .pptx
chempy ,this is the presentaion for chemistry .pptx
jawad Internship this is the presentation (1).pptx
Information security presentation donwe.pptx
Automatic interactive charts presentation for show.pptx
Lecture 5,6 [Autosavedaot IOT ]slides.pptx
MAHA PPT.pptx kncksd jkk cjkc kjkdsl alknxk
ARM PRESENTATION Final version.pptx jsjdkwn
Matplotlib_Presentation jk jdjklskncncsjkk
NLP_presentation on machine learning for human - Copy.pptx
Ad

Recently uploaded (20)

PDF
GSA-Past-Papers-2010-2024-2.pdf CSS examination
PDF
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
PPTX
4. Diagnosis and treatment planning in RPD.pptx
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
PDF
faiz-khans about Radiotherapy Physics-02.pdf
PPTX
growth and developement.pptxweeeeerrgttyyy
PPTX
CHROMIUM & Glucose Tolerance Factor.pptx
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PPTX
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
PPTX
MMW-CHAPTER-1-final.pptx major Elementary Education
PDF
Physical pharmaceutics two in b pharmacy
PPT
hsl powerpoint resource goyloveh feb 07.ppt
PDF
Health aspects of bilberry: A review on its general benefits
PPTX
Approach to a child with acute kidney injury
PDF
Laparoscopic Imaging Systems at World Laparoscopy Hospital
PPTX
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
PDF
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
PDF
POM_Unit1_Notes.pdf Introduction to Management #mba #bba #bcom #bballb #class...
PPTX
operating_systems_presentations_delhi_nc
PPTX
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx
GSA-Past-Papers-2010-2024-2.pdf CSS examination
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
4. Diagnosis and treatment planning in RPD.pptx
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
faiz-khans about Radiotherapy Physics-02.pdf
growth and developement.pptxweeeeerrgttyyy
CHROMIUM & Glucose Tolerance Factor.pptx
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
MMW-CHAPTER-1-final.pptx major Elementary Education
Physical pharmaceutics two in b pharmacy
hsl powerpoint resource goyloveh feb 07.ppt
Health aspects of bilberry: A review on its general benefits
Approach to a child with acute kidney injury
Laparoscopic Imaging Systems at World Laparoscopy Hospital
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
POM_Unit1_Notes.pdf Introduction to Management #mba #bba #bcom #bballb #class...
operating_systems_presentations_delhi_nc
ENGlishGrade8_Quarter2_WEEK1_LESSON1.pptx

NumPy_Presentation about Numerical python.pptx

  • 2. Introduction to NumPy • NumPy (Numerical Python) is a library for numerical computing in Python. It provides support for multi-dimensional arrays and mathematical functions.
  • 3. Creating NumPy Arrays • - From Python Lists: np.array([1, 2, 3]) • - From Built-in Methods: np.zeros(), np.ones(), np.arange(), np.linspace() • - From Random Module: np.random.rand(), np.random.randint()
  • 4. Array Attributes and Methods • - Reshape: arr.reshape(3,3) • - Max & Min: arr.max(), arr.min() • - Argmax & Argmin: arr.argmax(), arr.argmin() • - Shape: arr.shape • - Dtype: arr.dtype • - Size: arr.size • - Ndim: arr.ndim
  • 5. Operations on Arrays • - Copying: arr.copy() • - Appending & Inserting: np.append(), np.insert() • - Sorting: np.sort() • - Removing: np.delete() • - Concatenation: np.concatenate() • - Splitting: np.split()
  • 6. Data Loading & Saving • - Save: np.save('file.npy', arr) • - Load: np.load('file.npy') • - CSV Handling: np.savetxt('file.csv', arr), np.loadtxt('file.csv')
  • 7. NumPy Indexing and Selection • - Indexing 2D Array: arr[1,2] • - Logical Selection: arr[arr > 3]
  • 8. Broadcasting in NumPy • - Perform operations on arrays of different shapes without manual resizing • - Example: arr + 5, arr1 + arr2 (with different shapes)