How to create an array based on certain conditions in another array. For example, if I have an array that gives me a base number, a start and end number, and then a few other base numbers. I want to create a new matrix that lists the base number, the loop number (based on the start / end), and then another base number associated with this, ignoring 0. I am trying to find a way to do this without using the for loop.
For example, how can I get array B from array A.
Base Start End Base1 Base2 Base3
A=np.array([[100, 1, 2, 101, 102, 103],
[101, 3, 4, 100, 103, 0]])
B=np.array[[100,1,101,1],
[100,1,102,1],
[100,1,103,1],
[100,2,101,2],
[100,2,102,2],
[100,2,103,2],
[101,3,100,3],
[101,3,103,3],
[101,4,100,4],
[101,4,103,4]]
Thanks for the help!