diff --git a/array_manipulation.py b/array_manipulation.py index 3e61678..d298eaa 100644 --- a/array_manipulation.py +++ b/array_manipulation.py @@ -7,8 +7,8 @@ This script demonstrates basic NumPy array manipulation: """ # Product prices prices = np.array([15, 8, 22, 7, 12, 5]) -# Assign 20 to every price greater than 10 -prices[prices > 10] = 20 +# Add 20 to every price greater than 10 +prices[prices > 10] += 20 # Product ratings for two categories over three criteria ratings = np.array([[6, 8, 9], [7, 5, 10]])