slicing 2d array numpy code example
Example 1: python initialize a 2d array
x = [[foo for i in range(10)] for j in range(10)]
# x is now a 10x10 array of 'foo' (which can depend on i and j if you want)
Example 2: numpy 2d slicing
print(a2[:, 1]) # [2, 5, 8]
Example 3: 2d array python initialize
[[element] * numcols] * numrows