code: def choose_new_state(self, index):
          
          outputs, probabilities = zip(*[(transition.output_state, np.array(transition.probability(index)))
                                         for transition in self.transitions])
          probabilities = np.transpose(probabilities)
          outputs, probabilities = self._normalize_probabilities(outputs, probabilities)
          return outputs, self.random.choice(index, outputs, probabilities)
docs: Chooses a new state for each simulant in the index.
  
          Parameters
          ----------
          index : iterable of ints
              An iterable of integer labels for the simulants.
  
          Returns
          -------
          outputs : list
              The possible end states of this set of transitions.
          decisions: `pandas.Series`
              A series containing the name of the next state for each simulant in the index.