Logical Operations with NumPy Arrays
📖 Scenario: Imagine you work in a store that tracks daily sales of two products. You want to find days when certain sales conditions are met using logical operations.
🎯 Goal: You will create two NumPy arrays representing daily sales of two products. Then, you will use logical and, or, and not operations to find days matching specific sales conditions.
📋 What You'll Learn
Create two NumPy arrays named
product_a_sales and product_b_sales with exact daily sales values.Create a threshold variable named
threshold with the exact value 50.Use logical operations
np.logical_and, np.logical_or, and np.logical_not on the sales arrays.Print the final results arrays exactly as specified.
💡 Why This Matters
🌍 Real World
Stores and businesses often analyze sales data to find days when multiple products perform well or need attention.
💼 Career
Data analysts and scientists use logical operations on arrays to filter and analyze large datasets efficiently.
Progress0 / 4 steps