Question: import numpy as np a = np.array(1000*sin(arange(64)), dtype='int') a. reshape( (4,4,4)) #print(a) il = np.where(a==-988) i2 = np.where(a==-558) ans = np.array([il[i]+i2[i] for i in range(3)]).

 import numpy as np a = np.array(1000*sin(arange(64)), dtype='int') a. reshape( (4,4,4))

import numpy as np a = np.array(1000*sin(arange(64)), dtype='int') a. reshape( (4,4,4)) #print(a) il = np.where(a==-988) i2 = np.where(a==-558) ans = np.array([il[i]+i2[i] for i in range(3)]). print(ans) IndexError Traceback (most recent call last) in 8 i2 = np.where(a==-558) ---> 10 ans = np.array([i][i]+i2[i] for i in range(3)]) 11 print (ans) in (.0) 8 i2 = np.where(a==-558) ---> 10 ans = np.array( (il[i]+i2[i] for i in range (3)]) 11 print (ans) IndexError: tuple index out of range

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!