``````

In [1]:

import numpy as np

``````
``````

In [2]:

a = np.arange(120).reshape(2, 3, 4, 5)

``````
``````

In [3]:

print(a.shape)

``````
``````

(2, 3, 4, 5)

``````
``````

In [4]:

print(a[:, :, :, 0])

``````
``````

[[[  0   5  10  15]
[ 20  25  30  35]
[ 40  45  50  55]]

[[ 60  65  70  75]
[ 80  85  90  95]
[100 105 110 115]]]

``````
``````

In [5]:

print(a[..., 0])

``````
``````

[[[  0   5  10  15]
[ 20  25  30  35]
[ 40  45  50  55]]

[[ 60  65  70  75]
[ 80  85  90  95]
[100 105 110 115]]]

``````
``````

In [6]:

print(a[0, :, :, 0])

``````
``````

[[ 0  5 10 15]
[20 25 30 35]
[40 45 50 55]]

``````
``````

In [7]:

print(a[0, ..., 0])

``````
``````

[[ 0  5 10 15]
[20 25 30 35]
[40 45 50 55]]

``````
``````

In [8]:

print(a[Ellipsis, 0])

``````
``````

[[[  0   5  10  15]
[ 20  25  30  35]
[ 40  45  50  55]]

[[ 60  65  70  75]
[ 80  85  90  95]
[100 105 110 115]]]

``````
``````

In [9]:

print(a[0, Ellipsis, 0])

``````
``````

[[ 0  5 10 15]
[20 25 30 35]
[40 45 50 55]]

``````
``````

In [10]:

# print(a[..., 0, ...])
# IndexError: an index can only have a single ellipsis ('...')

``````
``````

In [11]:

print(a[0, 0, :, :])

``````
``````

[[ 0  1  2  3  4]
[ 5  6  7  8  9]
[10 11 12 13 14]
[15 16 17 18 19]]

``````
``````

In [12]:

print(a[0, 0])

``````
``````

[[ 0  1  2  3  4]
[ 5  6  7  8  9]
[10 11 12 13 14]
[15 16 17 18 19]]

``````
``````

In [13]:

print(a[0, 0, ...])

``````
``````

[[ 0  1  2  3  4]
[ 5  6  7  8  9]
[10 11 12 13 14]
[15 16 17 18 19]]

``````