code: def prune_neighbors(self):
          
          def _neighbor_check(neighbors,valid):
              if not neighbors==neighbors: return np.nan
              valid_keys = set(valid)&set(neighbors.keys())
              d = dict([(k,v) for k,v in neighbors.items() if k in valid_keys])
              return d
          fixed = self.copy()
          valid = self.get_valid_cell_indecies()
          valid = pd.DataFrame(self).merge(valid,on=self.frame_columns).set_index(self.frame_columns+['cell_index'])
          valid = valid.apply(lambda x: _neighbor_check(x['neighbors'],x['valid']),1).reset_index().\
              rename(columns={0:'new_neighbors'})
          fixed = fixed.merge(valid,on=self.frame_columns+['cell_index']).drop(columns='neighbors').\
              rename(columns={'new_neighbors':'neighbors'})
          fixed.microns_per_pixel = self.microns_per_pixel
          fixed.db = self.db
          #fixed.loc[:,'neighbors'] = list(new_neighbors)
          return fixed
docs: If the CellDataFrame has been subsetted, some of the cell-cell contacts may no longer be part of the the dataset.  This prunes those no-longer existant connections.
  
          Returns:
              CellDataFrame: A CellDataFrame with only valid cell-cell contacts