code: def propagate_measurement_info(self):
          
          meas_df = self.tables['measurements'].df
          names_list = ['specimen', 'sample', 'site', 'location']
          # add in any tables that you can
          for num, name in enumerate(names_list):
              # don't replace tables that already exist
              if (name + "s") in self.tables:
                  continue
              elif name in meas_df.columns:
                  items = meas_df[name].unique()
                  df = pd.DataFrame(columns=[name], index=items)
                  df[name] = df.index
                  # add in parent name if possible
                  # (i.e., sample name to specimens table)
                  if num < (len(names_list) - 1):
                      parent = names_list[num+1]
                      if parent in meas_df.columns:
                          meas_df = meas_df.where(meas_df.notnull(), "")
                          df[parent] = meas_df.drop_duplicates(subset=[name])[parent].values.astype(str)
                  df = df.where(df != "", np.nan)
                  df = df.dropna(how='all', axis='rows')
                  if len(df):
                      self.tables[name + "s"] = MagicDataFrame(dtype=name + "s", df=df)
                      self.write_table_to_file(name + "s")
docs: Take a contribution with a measurement table.
          Create specimen, sample, site, and location tables
          using the unique names in the measurement table to fill in
          the index.