code: def get_offdiag_vals(dcorr):
      
      del_indexes=[]
      for spc1 in np.unique(dcorr.index.get_level_values(0)):
          for spc2 in np.unique(dcorr.index.get_level_values(0)):
              if (not (spc1,spc2) in del_indexes) and (not (spc2,spc1) in del_indexes):
                  del_indexes.append((spc1,spc2))
      #         break
      for spc1 in np.unique(dcorr.index.get_level_values(0)):
          for spc2 in np.unique(dcorr.index.get_level_values(0)):
              if spc1==spc2:
                  del_indexes.append((spc1,spc2))
      
      return dcorr.drop(del_indexes)
docs: for lin dcorr i guess