I have a NumPy array with the shape (100, 170, 256). And I have an array consisting of indexes [0, 10, 20, 40, 70].

I can get the sub-arrays corresponding to the indexes as follows:

```
sub_array = array[..., index]

```

This returns an array with the shape (100, 170, 5) as expected. Now, I am trying to take the complement and get the sub-array NOT corresponding to those indexes. So, I did:

```
sub_array = array[..., ~index]

```

This still returns me an array of shape (100, 170, 5) for some reason. I wonder how to do this complement operation of these indexes in python?

[EDIT]

Also tried:

```
sub_array = array[..., not(index.any)]

```

However, this does not do the thing I want as well (getting array of shape (100, 170, 251).