I've got a 16000x16000
matrix and I need to extract a boolean mask from it.
The boolean mask indicates whether the value at a certain cell is higher than a THRESHOLD or not.
Here's the relevant snippet
def adj_mask( dmat ):
'''
Returns locations where value exceeds the threshold
'''
global DIST
return numpy.where(dmat > DIST)
I have various matrices for which I need to perform such selection. However, my whole system seems to almost freeze (hang) when I call it with a big (16000x16000
) matrix.
Please suggest how can I fasten up this computation?