I need to slice a list of lists in python.
A = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]] idx = slice(0,4) B = A[:][idx]
The code above isn\'t
A = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]] print [a[:3] for a in A]
Using list comprehension