Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python slice second element of list of lists

import numpy as np

A = np.array([[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]])
A[:,:3]

Out[3]: 
array([[1, 2, 3],
       [1, 2, 3],
       [1, 2, 3]])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #slice #element #list #lists
ADD COMMENT
Topic
Name
9+2 =