I just realized that my masked array doesn't work as indices for selection.
When I do mathematical operations, such as max()
it works, but not with selections.
import numpy as np
array = np.arange(3,8)
indices = np.ma.masked_array(np.arange(5),np.random.randint(0,2,5))
print('array data: %s' % array)
print('indices: %s' % indices)
print('-')
print('max index: %s - ok' % indices.max())
print('selecting on indices %s - not ok' % array[indices])
Am I missing something? Why wouldn't the above work?