I have a list X as below, and I can get the first column Y1 from X as below.
X=[
[0, 1, 2, 4],
[0, 5, 3, 4],
[0, 7, 5, 6],
[1, 7, 8, 6],
[2, 7, 3, 6],
[3, 7, 9, 6],
[0, 8, 4, 6],
[1, 8, 6, 6],
[2, 8, 5, 6],
[3, 8, 9, 6],
[0, 2, 6, 7],
[1, 2, 1, 7],
[2, 2, 4, 7],
[3, 2, 5, 7]
]
Y1=[
0,
0,
0,
1,
2,
3,
0,
1,
2,
3,
0,
1,
2,
3
]
But actually I want to get the result of Y2…
How to implement it base on list X by using python?
Any suggestions would be helpful, Thank you.
Y2=[
0,
1,
0,
1,
2,
3,
4,
5,
6,
7,
0,
1,
2,
3
]
New contributor
Hsin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.