code: def dense_rank(series, ascending=True):
      
  
      ranks = series.rank(method='dense', ascending=ascending)
      return ranks
docs: Equivalent to `series.rank(method='dense', ascending=ascending)`.
  
      Args:
          series: column to rank.
  
      Kwargs:
          ascending (bool): whether to rank in ascending order (default is `True`).