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
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.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
