Temperatures are [3, -1, 0, 4, -5]. Print a copy where every negative becomes 0 and the other numbers stay. Use np.where(condition, value_if_true, value_if_false).
Data analysis labNumPy problems
Problem 16 of 50 · Masks · Medium
Turn negatives into zero
Replace values with `np.where` instead of a loop.
Preparing NumPy, Pandas, and MatplotlibShift+Enter runs the cell you are in.
1
Your solution
2