I have a numpy array with some NaN values:
arr = [ 0, NaN, 2, NaN, NaN, 5, 6, 7 ]
Using some logic (outside of the question scope), I generate a mask of the NaN locations:
mask = [ True, False, True, False, False, True, True, True ]
I use this ...