R
Robrecht W. Uyttenhove
Hello,
I tried out the following code:
y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)][[0, 1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12, 13],
[14, 15, 16, 17, 18, 19, 20],
[21, 22, 23, 24, 25, 26, 27],
[28, 29, 30, 31, 32, 33, 34]]
I expected the 2D list:
[[ 7, 10, 13],
[21, 24, 27]]
Any ideas?
Thanks,
Rob
PS: I used Python 2.7.3
I tried out the following code:
y=[range(0,7),range(7,14),range(14,21),range(21,28),range(28,35)][[0, 1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12, 13],
[14, 15, 16, 17, 18, 19, 20],
[21, 22, 23, 24, 25, 26, 27],
[28, 29, 30, 31, 32, 33, 34]]
[[7, 8, 9, 10, 11, 12, 13]]y[1:5:2][::3]
I expected the 2D list:
[[ 7, 10, 13],
[21, 24, 27]]
Any ideas?
Thanks,
Rob
PS: I used Python 2.7.3