How to Use Conditional Expressions With NumPy where()
Suppose you have an array defined as follows:
Python
>>> import numpy as np
>>> quiz_array = np.arange(-10, 10).reshape(5, 4)
>>> quiz_array
array([[-10, -9, -8, -7],
[ -6, -5, -4, -3],
[ -2, -1, 0, 1],
[ 2, 3, 4, 5],
[ 6, 7, 8, 9]])
quiz_array
?
Don’t get your arguments mixed up. Remember, the documentation is there for a reason!
Sorry! There has been an error processing your answer. Please try again.