This paste expires on 2023-04-22 05:15:49.773107. Repaste, or download this paste. . Pasted through web.

X = [[-0.4838731,   0.08083195], [ 0.93456167, -0.50316134]]
G = [[ 0.19960269,  0.20993069], [-0.85814751, -0.41418101]]
# flatten
X = X.reshape(X.shape[0]*X.shape[1])
G = G.reshape(G.shape[0]*G.shape[1])
output = [G[i] if x >= 0 else 0 for x,i in enumerate(X)]
Filename: None. Size: 271b. View raw, , hex, or download this file.