get index of array based on value python