Introduction to NumPy

In [1]:
import numpy as np
In [2]:
grid = np.array([[1, 2, 3], [4, 5, 6]])
print(grid)
[[1 2 3]
 [4 5 6]]
In [3]:
grid[1, 0]
Out[3]:
4
In [4]:
grid[:, 2]
Out[4]:
array([3, 6])
In [5]:
grid[1, 1:]
Out[5]:
array([5, 6])