code: def _make_index(prob, size):
      """
      Returns a boolean index for given probabilities.
  
      Notes
      -----
      prob = [.75,.25] means that there is a 75% chance of the first column
      being True and a 25% chance of the second column being True. The
      columns are mutually exclusive.
      """
      rv = np.random.uniform(size=(size, 1))
      cumprob = np.cumsum(prob)
      return np.logical_and(np.r_[0, cumprob[:-1]] <= rv, rv < cumprob)
  
file_path: statsmodels/statsmodels/distributions/mixture_rvs.py
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _make_index(prob, size) and returns: np