How did you calculate the number of rows of observation0 and observation1?
Currently they are set to int(t/2), but what if the agent_index contains only zeros in row0?
This would create an index error or is this use case not possible?