code: def sortino_ratio(self, threshold=0.0, ddof=0, freq=None):
          
  
          stdev = self.semi_stdev(threshold=threshold, ddof=ddof, freq=freq)
          return (self.anlzd_ret() - threshold) / stdev
docs: Return over a threshold per unit of downside deviation.
  
          A performance appraisal ratio that replaces standard deviation
          in the Sharpe ratio with downside deviation.
          [Source: CFA Institute]
  
          Parameters
          ----------
          threshold : {float, TSeries, pd.Series}, default 0.
              While zero is the default, it is also customary to use
              a "minimum acceptable return" (MAR) or a risk-free rate.
              Note: this is assumed to be a *periodic*, not necessarily
              annualized, return.
          ddof : int, default 0
              Degrees of freedom, passed to pd.Series.std().
          freq : str or None, default None
              A frequency string used to create an annualization factor.
              If None, `self.freq` will be used.  If that is also None,
              a frequency will be inferred.  If none can be inferred,
              an exception is raised.
  
              It may be any frequency string or anchored offset string
              recognized by Pandas, such as 'D', '5D', 'Q', 'Q-DEC', or
              'BQS-APR'.
  
          Returns
          -------
          float