Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Module 7

Introduction to NumPy
In this module, you will delve into NumPy, a powerful library in Python essential for numerical operations.
NumPy is particularly useful for handling arrays and performing complex mathematical operations with
ease. This module will introduce you to the basics of NumPy, including the creation and manipulation of
arrays. Understanding NumPy is a crucial skill for anyone looking to work with data in Python, as it lays the
groundwork for more advanced data analysis and scientific computing.

Please use W3Schools Online Web Tutorials website to learn the following topics during your Online
Guided Learning (OGL) session.

Topics covered in this module:


• Introduction to NumPy

• Basics of NumPy Arrays

• Performing Basic Array Operations (Creating Arrays, Indexing, Slicing, Data Types, Shape, Reshape,
Iterating, Join, Split, Search, Sort, Filter, Random Number)

After studying the material, you should be able to:


• Understand the significance of NumPy in Python for numerical computing.

• Create and work with NumPy arrays.

• Conduct basic operations on arrays such as addition, subtraction, and finding statistical values.

Practice for This Module:


These questions are designed to ensure you effectively learn the key concepts of this module. Initially, try
to solve them without using Google search or AI tools. The focus here is on understanding and applying
your learning. If you need assistance, feel free to use AI tools like ChatGPT for hints.

Question 1: Write a program using NumPy to create a 3x3 matrix with values ranging from 1 to 9. Then,
reshape this matrix into a 9x1 array.
Question 2: Create a 1D NumPy array of 20 elements with random values. Write a script to extract all
elements from the 5th to the 15th position and replace them with zero. Then find the mean, median,
and standard deviation of resulting array.

You might also like