Indexing (a=0) as in (a==0)[:,None,None]adds new axes to the 1D boolean array (a=0). (a==0)[:,None,None] has shape (3,1,1). Similarly, (b==0)[None,:,None] has shape (1,3,1), and (c==0)[None,None,:] has shape (1,1,2).

When combined with & (bitwise-and), the three arrays are broadcasted to one common shape, (3,3,2). Thus, X gets indexed by one boolean array of shape (3,3,2) in