code: def set_index(data,col_index):
      
      if col_index in data:
          data=data.reset_index().set_index(col_index)
          if 'index' in data:
              del data['index']
          return data
      elif data.index.name==col_index:
          return data
      else:
          logging.error("something's wrong with the df")
          df2info(data)
docs: Sets the index if the index is not present
  
      :param data: pandas table 
      :param col_index: column name which will be assigned as a index