I would simply do 
```
 y = Y[:, class_index]
```