Why array creation matters
📖 Scenario: Imagine you are a data analyst working with sales data. You want to organize daily sales numbers into a structure that makes it easy to analyze and calculate totals.
🎯 Goal: You will create a NumPy array to hold sales data, set a threshold for high sales, filter the data based on this threshold, and finally display the filtered sales numbers.
📋 What You'll Learn
Create a NumPy array called
sales with these exact values: 10, 25, 30, 5, 40Create a variable called
threshold and set it to 20Use a NumPy expression to create a new array called
high_sales that contains only sales values greater than thresholdPrint the
high_sales array💡 Why This Matters
🌍 Real World
Data scientists often need to organize and filter data efficiently to find important information quickly.
💼 Career
Knowing how to create and filter arrays is a basic skill for data analysis and machine learning tasks.
Progress0 / 4 steps