Find Unique Elements Using np.unique()
📖 Scenario: You work in a store and have a list of product IDs sold today. Some products were sold multiple times.You want to find out which unique products were sold to understand your sales better.
🎯 Goal: Build a small program that uses np.unique() to find unique product IDs from a list.
📋 What You'll Learn
Create a numpy array called
product_ids with the exact values: [101, 203, 101, 405, 203, 507]Create a variable called
unique_products to store unique product IDs using np.unique()Print the
unique_products array to see the unique product IDs💡 Why This Matters
🌍 Real World
Finding unique items in sales data helps stores understand what products are popular and manage inventory better.
💼 Career
Data scientists often need to clean and analyze data by identifying unique values to prepare datasets for further analysis.
Progress0 / 4 steps