code: def returns_cumulative(returns, geometric=True, expanding=False):
      
      if expanding:
          if geometric:
              return (1. + returns).cumprod() - 1.
          else:
              return returns.cumsum()
      else:
          if geometric:
              return (1. + returns).prod() - 1.
          else:
              return returns.sum()
docs: return the cumulative return
  
      Parameters
      ----------
      returns : DataFrame or Series
      geometric : bool, default is True
                  If True, geometrically link returns
      expanding : bool default is False
                  If True, return expanding series/frame of returns
                  If False, return the final value(s)