Category : loops

I have two numpy Arrays X = np.array([[0,1,0,1,1], [0,1,1,1,0]]) X2 = np.array([[0.2,0.5,0.1,0.5,0.5], [0.3,0.6,0.6,0.6,0.4]]) What I want is to get a new array with values of X2 where X is 0 and sum this per row so my output should be [[0.3][0.7]] I used X2[X==0] This gives me all the 0s from the whole array not ..

Read more