code: def recov_date(self, return_date=False):
          
  
          dd = self.drawdown_idx()
          # False beginning on trough date and all later dates.
          mask = nancumprod(dd != nanmin(dd)).astype(bool)
          res = dd.mask(mask) == 0
  
          # If `res` is all False (recovery has not occured),
          # .idxmax() will return `res.index[0]`.
          if not res.any():
              recov = pd.NaT
          else:
              recov = res.idxmax()
  
          if return_date:
              return recov.date()
          return recov
docs: Drawdown recovery date.
  
          Date at which `self` recovered to previous high-water mark.
  
          Parameters
          ----------
          return_date : bool, default False
              If True, return a `datetime.date` object.
              If False, return a Pandas Timestamp object.
  
          Returns
          -------
          {datetime.date, pandas._libs.tslib.Timestamp, pd.NaT}
              Returns NaT if recovery has not occured.