The agent index will sequentially change. It will be 0, 1, 0, 1, 0, 1, … so half of the steps it is  0 and half 1. In this case a.shape[0] should be an even number (I updated the question). The only case that the mentioned sequence will change to sth like 0, 1, 0, 0, 1, 0, … is when the environment is done (which when I use -1 value for done, this case will not happen and I will have a sequence of 0 and 1 until I see -1). So maximum number of rows for each agent is int(t/2). If there is no -1 in that column, it would be half for agent 0 and half for agent 1 and if there is -1 in the column, I will fill it with some default values like zero.
It doesn’t matter if row values are the same or not. These are some parallel environments and the starting agent can be 0 or 1.