code: def _append_to_endog(endog, new_y):
      
      return np.concatenate((endog, new_y)) if \
          endog.ndim == 1 else \
          np.concatenate((endog.ravel(), new_y))[:, np.newaxis]
docs: Append to the endogenous array
  
      Parameters
      ----------
      endog : np.ndarray, shape=(n_samples, [1])
          The existing endogenous array
  
      new_y : np.ndarray, shape=(n_samples)
          The new endogenous array to append