how to address a column in a 2d array python

Solutions on MaxInterview for how to address a column in a 2d array python by the best coders in the world

showing results for - "how to address a column in a 2d array python"
Florencia
07 Jul 2018
1>>> import numpy as np
2>>> A = np.array([[1,2,3,4],[5,6,7,8]])
3
4>>> A
5array([[1, 2, 3, 4],
6    [5, 6, 7, 8]])
7
8>>> A[:,2] # returns the third columm
9array([3, 7])