code: def sma(arg, n):
      
      if n == 0:
          return pd.expanding_mean(arg)
      else:
          return pd.rolling_mean(arg, n, min_periods=n)
docs: If n is 0 then return the ltd mean; else return the n day mean