0% found this document useful (0 votes)
22 views7 pages

NumPy_Presentation - Copy

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views7 pages

NumPy_Presentation - Copy

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to NumPy

A Powerful Python Library for


Numerical Computation
By Shaju K
What is NumPy?
• • A Python library for large-scale numerical
computation.
• • Provides an N-dimensional array object.
• • Includes tools for integrating C/C++ code.
• • Offers mathematical and statistical
functions.
Why Use NumPy?
• • Efficiency: Faster computations with arrays.
• • Versatility: Supports linear algebra, Fourier
transforms, and random number generation.
• • Scalability: Handles large datasets easily.
Installing NumPy
• Install NumPy using pip:
• ```python
• pip install numpy
• ```

• Verify installation:
• ```python
• import numpy
• print(numpy.__version__)
Understanding NumPy Arrays
• • NumPy arrays are more efficient than
Python lists.
• • Example:
• ```python
• import numpy as np
• arr = np.array([1, 2, 3])
• print(arr)
• ```
Creating Arrays
• Examples:
• ```python
• np.array([1, 2, 3]) # 1D Array
• np.array([[1, 2], [3, 4]]) # 2D Array
• np.zeros((2, 2)) # Zeroes
• np.ones((3, 3)) # Ones
• np.arange(1, 10, 2) # Range
• ```
Array Indexing and Slicing
• Example:
• ```python
• arr = np.array([10, 20, 30, 40])
• print(arr[1]) # Access single element
• print(arr[1:3]) # Slice elements
• ```

You might also like