code: def sharpe_ratio(self, rf=0.02, ddof=0):
          
  
          rf = self._validate_rf(rf)
          stdev = self.anlzd_stdev(ddof=ddof)
          return (self.anlzd_ret() - rf) / stdev
docs: Return over `rf` per unit of total risk.
  
          The average return in excess of the risk-free rate divided
          by the standard deviation of return; a measure of the average
          excess return earned per unit of standard deviation of return.
          [Source: CFA Institute]
  
          Parameters
          ----------
          rf : {float, TSeries, pd.Series}, default 0.02
              If float, this represents an *compounded annualized*
              risk-free rate; 2.0% is the default.
              If a TSeries or pd.Series, this represents a time series
              of periodic returns to a risk-free security.
  
              To download a risk-free rate return series using
              3-month US T-bill yields, see:`pyfinance.datasets.load_rf`.
          ddof : int, default 0
              Degrees of freedom, passed to pd.Series.std().
  
          Returns
          -------
          float