docs: def create_deepcopied_groupby_dict(orig_df, obs_id_col):
      """
      Will create a dictionary where each key corresponds to a unique value in
      `orig_df[obs_id_col]` and each value corresponds to all of the rows of
      `orig_df` where `orig_df[obs_id_col] == key`.
  
      Parameters
      ----------
      orig_df : pandas DataFrame.
          Should be long-format dataframe containing the data used to estimate
          the desired choice model.
      obs_id_col : str.
          Should be a column name within `orig_df`. Should denote the original
          observation id column.
  
      Returns
      -------
      groupby_dict : dict.
          Each key will be a unique value in `orig_df[obs_id_col]` and each value
          will be the rows of `orig_df` where `orig_df[obs_id_col] == key`.
      """
      # Get the observation id values
      obs_id_vals = orig_df[obs_id_col].values
      # Get the unique observation ids
      unique_obs_ids = np.unique(obs_id_vals)
      # Initialize the dictionary to be returned.
      groupby_dict = {}
      # Populate the dictionary with dataframes for each individual.
      for obs_id in unique_obs_ids:
          # Filter out only the rows corresponding to the current observation id.
          desired_rows = obs_id_vals == obs_id
          # Add the desired dataframe to the dictionary.
          groupby_dict[obs_id] = orig_df.loc[desired_rows].copy(deep=True)
  
      # Return the desired object.
      return groupby_dict