def indices_to_mask(indices, mask_length):
 if (mask_length <= np.max(indices)):
  raise ValueError('mask_length must be greater than max(indices)')
 mask = np.zeros(mask_length, dtype=np.bool)
 mask[indices] = True
 return mask

def indices_to_mask ( indices , mask_length ) : if ( mask_length <= np . max ( indices ) ) : raise ValueError ( 'mask_length must be greater than max(indices)' ) mask = np . zeros ( mask_length , dtype = np . bool ) mask [ indices ] = True return mask
convert list of indices to boolean mask .