code: def looks_like_index(series, index_names=('Unnamed: 0', 'pk', 'index', '')):
      
      if series.name in index_names:
          return True
      if (series == series.index.values).all():
          return True
      if (series == np.arange(len(series))).all():
          return True
      if (
          (series.index == np.arange(len(series))).all() and
          str(series.dtype).startswith('int') and
          (series.count() == len(series))
      ):
          return True
      return False
docs: Tries to infer if the Series (usually leftmost column) should be the index_col
  
      >>> looks_like_index(pd.Series(np.arange(100)))
      True