I'm trying to do what I think should be simple:
I make a 2D list:
a = [[1,5],[2,6],[3,7]]
and I want to slide out the first column
and tried:
1)
a[:,0]
...
TypeError: list indices must be integers or slices, not tuple
2)
a[:,0:1]
...
TypeError: list indices must be integers or slices, not tuple
3)
a[:][0]
[1, 5]
4)
a[0][:]
[1, 5]
5) got it but is this the way to do it?
aa[0] for aa in a
Using numpy
it would be easy but what is the Python way?