modified line 11 to add 20 to elements > 10

This commit is contained in:
Donald Calloway 2025-09-29 10:26:30 -07:00
parent d45a31970f
commit 9f57dddd92

View File

@ -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]])