## I. y (Indices)

The indexes of every non-zero in y.

I. 0 0 1 0 1 0
2 4

If y has a number n>1, e.g. 6, then its index gets replicated n times

I. 0 0 6 0 1 0
2 2 2 2 2 2 4

### Common uses

Sample data for what follows

] y=: i:3       NB. sample data
_3 _2 _1 0 1 2 3

1. Replace the common idiom: cond # i.#y where cond is a Boolean condition

y=: i:3
] cond=: y<0
1 1 1 0 0 0 0
cond # i.#y
0 1 2

2. Replace all atoms in y satisfying a given Boolean condition

• e.g. replace all negative numbers with 0

0 (I. y<0) } y  NB. replace all y<0 with 0
0 0 0 0 1 2 3

## x I. y (Interval Index)

The index of the interval (defined by x) in which y lies

• each interval being defined by a pair of consecutive numbers in x

x=: 0 1 2 4 8 16 32   NB. x represents the 8 intervals:
NB. (__,0], (0,1], (1,2], (2,4],
NB. (4,8], (8,16], (16,32], (32,_]

x I. _100   NB. _100 is in (__,0] -- which has index 0 in x
0
x I. 0.9    NB. 0.9 is in (0,1] -- which has index 1 in x
1
x I. 3.9    NB. 3.9 is in (2,4] -- which has index 3 in x
3
x I. 16     NB. 16 is in (8,16] -- which has index 5 in x
5
x I. 17     NB. 17 is in (16,32] -- which has index 6 in x
6
x I. 32     NB. 32 is in (16,32] -- which has index 6 in x
6
x I. 33     NB. 33 is in (33,_] -- which has index 7 in x
7
x I. 15 16 17   NB. 3 search terms at once
5 5 6

### Common uses

Identify which interval (of a set of intervals) y lies in.

• as above