code: def calc_cagr(prices):
      
      start = prices.index[0]
      end = prices.index[-1]
      return (prices.iloc[-1] / prices.iloc[0]) ** (1 / year_frac(start, end)) - 1
docs: Calculates the `CAGR (compound annual growth rate) <https://www.investopedia.com/terms/c/cagr.asp>`_ for a given price series.
  
      Args:
          * prices (pandas.Series): A Series of prices.
      Returns:
          * float -- cagr.