Finding Unique Values with np.unique()
📖 Scenario: You work in a store that tracks daily sales of different fruits. Sometimes the same fruit is sold multiple times in a day. You want to find out which unique fruits were sold today.
🎯 Goal: Build a small program that uses np.unique() to find all unique fruits sold from a list of sales.
📋 What You'll Learn
Create a numpy array called
sales with the exact fruit names given.Create a variable called
unique_fruits that stores the unique fruit names using np.unique().Print the
unique_fruits array to see the result.💡 Why This Matters
🌍 Real World
Stores and businesses often need to find unique items sold or listed to analyze inventory or sales trends.
💼 Career
Data analysts and scientists use <code>np.unique()</code> to quickly find unique values in datasets for reporting and decision making.
Progress0 / 4 steps