python slice second element of list of lists

Solutions on MaxInterview for python slice second element of list of lists by the best coders in the world

showing results for - "python slice second element of list of lists"
Francisco
04 Oct 2020
1import numpy as np
2
3A = np.array([[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]])
4A[:,:3]
5
6Out[3]: 
7array([[1, 2, 3],
8       [1, 2, 3],
9       [1, 2, 3]])
similar questions