0
0
NumPydata~15 mins

What is NumPy - Hands-On Activity

Choose your learning style9 modes available
What is NumPy
📖 Scenario: Imagine you want to work with numbers in your computer, like adding many numbers or finding averages. Doing this with just normal lists can be slow and tricky. NumPy is a tool that helps you work with numbers easily and fast.
🎯 Goal: You will create a simple list of numbers, then use NumPy to turn it into a special array. You will also see how to print this array to understand what NumPy does.
📋 What You'll Learn
Create a list of numbers
Import the NumPy library
Convert the list to a NumPy array
Print the NumPy array
💡 Why This Matters
🌍 Real World
NumPy is used in science, engineering, and data analysis to handle large sets of numbers quickly and easily.
💼 Career
Knowing NumPy is important for jobs in data science, machine learning, and any role that involves working with numbers and data.
Progress0 / 4 steps
1
Create a list of numbers
Create a list called numbers with these exact values: 10, 20, 30, 40, 50.
NumPy
Need a hint?

Use square brackets [] to create a list and separate numbers with commas.

2
Import the NumPy library
Import the NumPy library using the alias np.
NumPy
Need a hint?

Use the import keyword followed by numpy as np.

3
Convert the list to a NumPy array
Create a variable called array_numbers and set it to the NumPy array version of the numbers list using np.array().
NumPy
Need a hint?

Use np.array() and pass the list numbers inside the parentheses.

4
Print the NumPy array
Print the variable array_numbers to see the NumPy array output.
NumPy
Need a hint?

Use the print() function to display the array.