For python: Use np.random.rand(5,5) to create a random 5x5 array. Use boolean indexing to set the nine
Fantastic news! We've Found the answer you've been seeking!
Question:
For python: Use np.random.rand(5,5) to create a random 5x5 array. Use boolean indexing to set the nine entries in a 3x3 block in the bottom right corner to 0. Print the result. (Hint: Use np.ones() or np.zeros() with the dtype argument to get a 5x5 array full of True's or False's. Use this array to build a boolean filter, in order to set only the entries you want equal to 0.)
Related Book For
Posted Date: