I would like to do list comprehension only on the second and third element of each sub-list. I've been able to do this, but I lose the first element. I know I could do this pretty easily with a for loop, but I'd like to be pythonic (idiomatic python) and use list comprehension.
test = [[3,6,9],[3,6,9]]
v = [[x/3.0 for x in y[1:3]] for y in test]
print v
Output
[[2.0, 3.0], [2.0, 3.0]]
Desired output
[[3, 2.0, 3.0], [3, 2.0, 3.0]]