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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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