docs: def create_row_to_some_id_col_mapping(id_array):
      """
      Parameters
      ----------
      id_array : 1D ndarray.
          All elements of the array should be ints representing some id related
          to the corresponding row.
  
      Returns
      -------
      rows_to_ids : 2D scipy sparse array.
          Will map each row of id_array to the unique values of `id_array`. The
          columns of the returned sparse array will correspond to the unique
          values of `id_array`, in the order of appearance for each of these
          unique values.
      """
      # Get the unique ids, in their original order of appearance
      original_order_unique_ids = get_original_order_unique_ids(id_array)
  
      # Create a matrix with the same number of rows as id_array but a single
      # column for each of the unique IDs. This matrix will associate each row
      # as belonging to a particular observation using a one and using a zero to
      # show non-association.
      rows_to_ids = (id_array[:, None] ==
                     original_order_unique_ids[None, :]).astype(int)
      return rows_to_ids