Question: I have a 3D array with a shape `(255,255,158)` these are 158 images of 255x255 resolution.

How can I delete even a number of images, so the shape should be like `(255,255,79)`?

Answer: 
Use numpy's [`delete`](https://numpy.org/doc/stable/reference/generated/numpy.delete.html?highlight=delete#numpy.delete) function, for example if you want to delete the first, 50-th and 78-th image of your `array` you can simply do :

```
index = np.array([0, 49, 77])
output = np.delete(array, index, axis=-1)

```

If you want every even index to be deleted, you can do :

```
index = np.arange(0, array.shape[2], 2)

```
you can always just use the python colon function

<http://www.hpc-carpentry.org/hpc-python/03-lists/index.html>

```
arr = arr[:,:,:int(arr.shape[2]/2)]

```