code: def prep_for_intensity_plot(data, meth_code, dropna=(), reqd_cols=()):
      
      # initialize
      dropna = list(dropna)
      reqd_cols = list(reqd_cols)
      # get intensity column
      try:
          magn_col = get_intensity_col(data)
      except AttributeError:
          return False, "Could not get intensity method from data"
      # drop empty columns
      if magn_col not in dropna:
          dropna.append(magn_col)
      data = data.dropna(axis=0, subset=dropna)
      # add to reqd_cols list
      if 'method_codes' not in reqd_cols:
          reqd_cols.append('method_codes')
      if magn_col not in reqd_cols:
          reqd_cols.append(magn_col)
      # drop non reqd cols, make sure all reqd cols are present
      try:
          data = data[reqd_cols]
      except KeyError as ex:
          print(ex)
          missing = set(reqd_cols).difference(data.columns)
          return False, "missing these required columns: {}".format(", ".join(missing))
      # filter out records without the correct method code
      data = data[data['method_codes'].str.contains(meth_code).astype(bool)]
      return True, data
docs: Strip down measurement data to what is needed for an intensity plot.
      Find the column with intensity data.
      Drop empty columns, and make sure required columns are present.
      Keep only records with the specified method code.
  
      Parameters
      ----------
      data : pandas DataFrame
          measurement dataframe
      meth_code : str
          MagIC method code to include, i.e. 'LT-AF-Z'
      dropna : list
          columns that must not be empty
      reqd_cols : list
          columns that must be present
  
      Returns
      ----------
      status : bool
          True if successful, else False
      data : pandas DataFrame
          measurement data with required columns