as_indices function

Convert indicator to index