In [1]:
import numpy as np

In [2]:
>>> x = np.array([[[1],[2],[3]], [[4],[5],[6]]])
>>> x.shape


Out[2]:
(2, 3, 1)

In [3]:
>>> x[1:2]


Out[3]:
array([[[4],
        [5],
        [6]]])

In [4]:
x = np.array([[[1],[2],[3]], [[4],[5],[6]]])

In [5]:
x.ndim


Out[5]:
3

In [6]:
x = np.array([1, 2, 3])

In [7]:
x.ndim


Out[7]:
1

In [8]:
x.shape


Out[8]:
(3,)

In [9]:
x[1]


Out[9]:
2

In [10]:
x = np.array([[1, 2, 3], [4, 5, 6]])
x.ndim, x.shape


Out[10]:
(2, (2, 3))

In [11]:
x[0]


Out[11]:
array([1, 2, 3])

In [12]:
x[1]


Out[12]:
array([4, 5, 6])

In [13]:
%timeit x[0, 1]
x[0, 1]


The slowest run took 21.43 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 694 ns per loop
Out[13]:
2

In [14]:
%timeit x[(0, 1)]
x[(0, 1)]


The slowest run took 14.98 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 727 ns per loop
Out[14]:
2

In [15]:
%timeit x[0][1]
x[0][1]


The slowest run took 10.93 times longer than the fastest. This could mean that an intermediate result is being cached.
100000 loops, best of 3: 1.37 µs per loop
Out[15]:
2