I have this 1d array which represents the ranges of valid values.
ranges = np.array([1, 2, 0])
and i have multiple 2d arrays that have values, which i want to mask by index based on the ranges above.
matrixes = np.array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
So each value in "ranges" represents the number of rows that have valid values in "matrixes" (the columns correspond to each-other), so the masking would return something like:
([[True, True, False],
[False, True, False],
[False, False, False]])
The first column has 1 valid value, the first. The second column has 2 valid values... etc.
I tried several other topics but could not figure out how to do it... ex: How to properly mask a numpy 2D array?