find_index function

Find index of data that satisfies certain conditions